xref: /freebsd/sys/dev/isci/scil/scic_user_callback.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1f11c7f63SJim Harris /*-
2718cf2ccSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
3718cf2ccSPedro F. Giffuni  *
4f11c7f63SJim Harris  * This file is provided under a dual BSD/GPLv2 license.  When using or
5f11c7f63SJim Harris  * redistributing this file, you may do so under either license.
6f11c7f63SJim Harris  *
7f11c7f63SJim Harris  * GPL LICENSE SUMMARY
8f11c7f63SJim Harris  *
9f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
10f11c7f63SJim Harris  *
11f11c7f63SJim Harris  * This program is free software; you can redistribute it and/or modify
12f11c7f63SJim Harris  * it under the terms of version 2 of the GNU General Public License as
13f11c7f63SJim Harris  * published by the Free Software Foundation.
14f11c7f63SJim Harris  *
15f11c7f63SJim Harris  * This program is distributed in the hope that it will be useful, but
16f11c7f63SJim Harris  * WITHOUT ANY WARRANTY; without even the implied warranty of
17f11c7f63SJim Harris  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18f11c7f63SJim Harris  * General Public License for more details.
19f11c7f63SJim Harris  *
20f11c7f63SJim Harris  * You should have received a copy of the GNU General Public License
21f11c7f63SJim Harris  * along with this program; if not, write to the Free Software
22f11c7f63SJim Harris  * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23f11c7f63SJim Harris  * The full GNU General Public License is included in this distribution
24f11c7f63SJim Harris  * in the file called LICENSE.GPL.
25f11c7f63SJim Harris  *
26f11c7f63SJim Harris  * BSD LICENSE
27f11c7f63SJim Harris  *
28f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29f11c7f63SJim Harris  * All rights reserved.
30f11c7f63SJim Harris  *
31f11c7f63SJim Harris  * Redistribution and use in source and binary forms, with or without
32f11c7f63SJim Harris  * modification, are permitted provided that the following conditions
33f11c7f63SJim Harris  * are met:
34f11c7f63SJim Harris  *
35f11c7f63SJim Harris  *   * Redistributions of source code must retain the above copyright
36f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer.
37f11c7f63SJim Harris  *   * Redistributions in binary form must reproduce the above copyright
38f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer in
39f11c7f63SJim Harris  *     the documentation and/or other materials provided with the
40f11c7f63SJim Harris  *     distribution.
41f11c7f63SJim Harris  *
42f11c7f63SJim Harris  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43f11c7f63SJim Harris  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44f11c7f63SJim Harris  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45f11c7f63SJim Harris  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46f11c7f63SJim Harris  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47f11c7f63SJim Harris  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48f11c7f63SJim Harris  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49f11c7f63SJim Harris  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50f11c7f63SJim Harris  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51f11c7f63SJim Harris  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52f11c7f63SJim Harris  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53f11c7f63SJim Harris  */
54f11c7f63SJim Harris #ifndef _SCIC_USER_CALLBACK_H_
55f11c7f63SJim Harris #define _SCIC_USER_CALLBACK_H_
56f11c7f63SJim Harris 
57f11c7f63SJim Harris /**
58f11c7f63SJim Harris  * @file
59f11c7f63SJim Harris  *
60f11c7f63SJim Harris  * @brief This file contains all of the interface methods/macros that must
61f11c7f63SJim Harris  *        be implemented by an SCI Core user.
62f11c7f63SJim Harris  */
63f11c7f63SJim Harris 
64f11c7f63SJim Harris #ifdef __cplusplus
65f11c7f63SJim Harris extern "C" {
66f11c7f63SJim Harris #endif // __cplusplus
67f11c7f63SJim Harris 
68f11c7f63SJim Harris #include <dev/isci/scil/sci_types.h>
69f11c7f63SJim Harris #include <dev/isci/scil/sci_status.h>
70f11c7f63SJim Harris #include <dev/isci/scil/sci_controller.h>
71f11c7f63SJim Harris 
72f11c7f63SJim Harris /**
73f11c7f63SJim Harris  * @brief This callback method asks the user to create a timer and provide
74f11c7f63SJim Harris  *        a handle for this timer for use in further timer interactions.
75f11c7f63SJim Harris  *
76f11c7f63SJim Harris  * @warning The "timer_callback" method should be executed in a mutually
77*2dfcc3a9SGordon Bergling  *          exclusive  manner from the controller completion handler
78f11c7f63SJim Harris  *          handler (refer to scic_controller_get_handler_methods()).
79f11c7f63SJim Harris  *
80f11c7f63SJim Harris  * @param[in]  controller This parameter specifies the controller with
81f11c7f63SJim Harris  *             which this timer is to be associated.
82f11c7f63SJim Harris  * @param[in]  timer_callback This parameter specifies the callback method
83f11c7f63SJim Harris  *             to be invoked whenever the timer expires.
84f11c7f63SJim Harris  * @param[in]  cookie This parameter specifies a piece of information that
85f11c7f63SJim Harris  *             the user must retain.  This cookie is to be supplied by the
86f11c7f63SJim Harris  *             user anytime a timeout occurs for the created timer.
87f11c7f63SJim Harris  *
88f11c7f63SJim Harris  * @return This method returns a handle to a timer object created by the
89f11c7f63SJim Harris  *         user.  The handle will be utilized for all further interactions
90f11c7f63SJim Harris  *         relating to this timer.
91f11c7f63SJim Harris  */
92f11c7f63SJim Harris void * scic_cb_timer_create(
93f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T   controller,
94f11c7f63SJim Harris    SCI_TIMER_CALLBACK_T      timer_callback,
95f11c7f63SJim Harris    void                    * cookie
96f11c7f63SJim Harris );
97f11c7f63SJim Harris 
98f11c7f63SJim Harris /**
99453130d9SPedro F. Giffuni  * @brief This callback method asks the user to destroy the supplied timer.
100f11c7f63SJim Harris  *
101f11c7f63SJim Harris  * @param[in]  controller This parameter specifies the controller with
102f11c7f63SJim Harris  *             which this timer is to associated.
103f11c7f63SJim Harris  * @param[in]  timer This parameter specifies the timer to be destroyed.
104f11c7f63SJim Harris  *
105f11c7f63SJim Harris  * @return none
106f11c7f63SJim Harris  */
107f11c7f63SJim Harris void scic_cb_timer_destroy(
108f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T   controller,
109f11c7f63SJim Harris    void                    * timer
110f11c7f63SJim Harris );
111f11c7f63SJim Harris 
112f11c7f63SJim Harris /**
113f11c7f63SJim Harris  * @brief This callback method asks the user to start the supplied timer.
114f11c7f63SJim Harris  *
115f11c7f63SJim Harris  * @warning All timers in the system started by the SCI Core are one shot
116f11c7f63SJim Harris  *          timers.  Therefore, the SCI user should make sure that it
117f11c7f63SJim Harris  *          removes the timer from it's list when a timer actually fires.
118f11c7f63SJim Harris  *          Additionally, SCI Core user's should be able to handle
119f11c7f63SJim Harris  *          calls from the SCI Core to stop a timer that may already
120f11c7f63SJim Harris  *          be stopped.
121f11c7f63SJim Harris  *
122f11c7f63SJim Harris  * @param[in]  controller This parameter specifies the controller with
123f11c7f63SJim Harris  *             which this timer is to associated.
124f11c7f63SJim Harris  * @param[in]  timer This parameter specifies the timer to be started.
125f11c7f63SJim Harris  * @param[in]  milliseconds This parameter specifies the number of
126f11c7f63SJim Harris  *             milliseconds for which to stall.  The operating system driver
127f11c7f63SJim Harris  *             is allowed to round this value up where necessary.
128f11c7f63SJim Harris  *
129f11c7f63SJim Harris  * @return none
130f11c7f63SJim Harris  */
131f11c7f63SJim Harris void scic_cb_timer_start(
132f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T   controller,
133f11c7f63SJim Harris    void                    * timer,
134f11c7f63SJim Harris    U32                       milliseconds
135f11c7f63SJim Harris );
136f11c7f63SJim Harris 
137f11c7f63SJim Harris /**
138f11c7f63SJim Harris  * @brief This callback method asks the user to stop the supplied timer.
139f11c7f63SJim Harris  *
140f11c7f63SJim Harris  * @param[in]  controller This parameter specifies the controller with
141f11c7f63SJim Harris  *             which this timer is to associated.
142f11c7f63SJim Harris  * @param[in]  timer This parameter specifies the timer to be stopped.
143f11c7f63SJim Harris  *
144f11c7f63SJim Harris  * @return none
145f11c7f63SJim Harris  */
146f11c7f63SJim Harris void scic_cb_timer_stop(
147f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T   controller,
148f11c7f63SJim Harris    void                    * timer
149f11c7f63SJim Harris );
150f11c7f63SJim Harris 
151f11c7f63SJim Harris /**
152f11c7f63SJim Harris  * @brief This method is called when the core requires the OS driver
153f11c7f63SJim Harris  *        to stall execution.  This method is utilized during initialization
154f11c7f63SJim Harris  *        or non-performance paths only.
155f11c7f63SJim Harris  *
156f11c7f63SJim Harris  * @param[in]  microseconds This parameter specifies the number of
157f11c7f63SJim Harris  *             microseconds for which to stall.  The operating system driver
158f11c7f63SJim Harris  *             is allowed to round this value up where necessary.
159f11c7f63SJim Harris  *
160f11c7f63SJim Harris  * @return none.
161f11c7f63SJim Harris  */
162f11c7f63SJim Harris void scic_cb_stall_execution(
163f11c7f63SJim Harris    U32  microseconds
164f11c7f63SJim Harris );
165f11c7f63SJim Harris 
166f11c7f63SJim Harris /**
167f11c7f63SJim Harris  * @brief This user callback will inform the user that the controller has
168f11c7f63SJim Harris  *        finished the start process.
169f11c7f63SJim Harris  *
170f11c7f63SJim Harris  * @param[in]  controller This parameter specifies the controller that was
171f11c7f63SJim Harris  *             started.
172f11c7f63SJim Harris  * @param[in]  completion_status This parameter specifies the results of
173f11c7f63SJim Harris  *             the start operation.  SCI_SUCCESS indicates successful
174f11c7f63SJim Harris  *             completion.
175f11c7f63SJim Harris  *
176f11c7f63SJim Harris  * @return none
177f11c7f63SJim Harris  */
178f11c7f63SJim Harris void scic_cb_controller_start_complete(
179f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
180f11c7f63SJim Harris    SCI_STATUS               completion_status
181f11c7f63SJim Harris );
182f11c7f63SJim Harris 
183f11c7f63SJim Harris /**
184f11c7f63SJim Harris  * @brief This user callback will inform the user that the controller has
185f11c7f63SJim Harris  *        finished the stop process.
186f11c7f63SJim Harris  *
187f11c7f63SJim Harris  * @param[in]  controller This parameter specifies the controller that was
188f11c7f63SJim Harris  *             stopped.
189f11c7f63SJim Harris  * @param[in]  completion_status This parameter specifies the results of
190f11c7f63SJim Harris  *             the stop operation.  SCI_SUCCESS indicates successful
191f11c7f63SJim Harris  *             completion.
192f11c7f63SJim Harris  *
193f11c7f63SJim Harris  * @return none
194f11c7f63SJim Harris  */
195f11c7f63SJim Harris void scic_cb_controller_stop_complete(
196f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
197f11c7f63SJim Harris    SCI_STATUS               completion_status
198f11c7f63SJim Harris );
199f11c7f63SJim Harris 
200f11c7f63SJim Harris /**
201f11c7f63SJim Harris  * @brief This user callback will inform the user that an IO request has
202f11c7f63SJim Harris  *        completed.
203f11c7f63SJim Harris  *
204f11c7f63SJim Harris  * @param[in]  controller This parameter specifies the controller on
205f11c7f63SJim Harris  *             which the IO is completing.
206f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device on
207f11c7f63SJim Harris  *             which this IO request is completing.
208f11c7f63SJim Harris  * @param[in]  io_request This parameter specifies the IO request that has
209f11c7f63SJim Harris  *             completed.
210f11c7f63SJim Harris  * @param[in]  completion_status This parameter specifies the results of
211f11c7f63SJim Harris  *             the IO request operation.  SCI_SUCCESS indicates successful
212f11c7f63SJim Harris  *             completion.
213f11c7f63SJim Harris  *
214f11c7f63SJim Harris  * @return none
215f11c7f63SJim Harris  */
216f11c7f63SJim Harris void scic_cb_io_request_complete(
217f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T     controller,
218f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
219f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T     io_request,
220f11c7f63SJim Harris    SCI_IO_STATUS               completion_status
221f11c7f63SJim Harris );
222f11c7f63SJim Harris 
223f11c7f63SJim Harris /**
224f11c7f63SJim Harris  * @brief This method simply returns the virtual address associated
225f11c7f63SJim Harris  *        with the scsi_io and byte_offset supplied parameters.
226f11c7f63SJim Harris  *
227f11c7f63SJim Harris  * @note This callback is not utilized in the fast path.  The expectation
228f11c7f63SJim Harris  *       is that this method is utilized for items such as SCSI to ATA
229f11c7f63SJim Harris  *       translation for commands like INQUIRY, READ CAPACITY, etc.
230f11c7f63SJim Harris  *
231f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
232f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
233f11c7f63SJim Harris  *            provide the necessary information for this callback.
234f11c7f63SJim Harris  * @param[in] byte_offset This parameter specifies the offset into the data
235f11c7f63SJim Harris  *            buffers pointed to by the SGL.  The byte offset starts at 0
236f11c7f63SJim Harris  *            and continues until the last byte pointed to be the last SGL
237f11c7f63SJim Harris  *            element.
238f11c7f63SJim Harris  *
239f11c7f63SJim Harris  * @return A virtual address pointer to the location specified by the
240f11c7f63SJim Harris  *         parameters.
241f11c7f63SJim Harris  */
242f11c7f63SJim Harris U8 *scic_cb_io_request_get_virtual_address_from_sgl(
243f11c7f63SJim Harris    void * scic_user_io_request,
244f11c7f63SJim Harris    U32    byte_offset
245f11c7f63SJim Harris );
246f11c7f63SJim Harris 
247f11c7f63SJim Harris /**
248f11c7f63SJim Harris  * @brief This user callback will inform the user that a task management
249f11c7f63SJim Harris  *        request completed.
250f11c7f63SJim Harris  *
251f11c7f63SJim Harris  * @param[in]  controller This parameter specifies the controller on
252f11c7f63SJim Harris  *             which the task management request is completing.
253f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device on
254f11c7f63SJim Harris  *             which this task management request is completing.
255f11c7f63SJim Harris  * @param[in]  task_request This parameter specifies the task management
256f11c7f63SJim Harris  *             request that has completed.
257f11c7f63SJim Harris  * @param[in]  completion_status This parameter specifies the results of
258f11c7f63SJim Harris  *             the IO request operation.  SCI_SUCCESS indicates successful
259f11c7f63SJim Harris  *             completion.
260f11c7f63SJim Harris  *
261f11c7f63SJim Harris  * @return none
262f11c7f63SJim Harris  */
263f11c7f63SJim Harris void scic_cb_task_request_complete(
264f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T     controller,
265f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
266f11c7f63SJim Harris    SCI_TASK_REQUEST_HANDLE_T   task_request,
267f11c7f63SJim Harris    SCI_TASK_STATUS             completion_status
268f11c7f63SJim Harris );
269f11c7f63SJim Harris 
270f11c7f63SJim Harris #ifndef SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED
271f11c7f63SJim Harris /**
272f11c7f63SJim Harris  * @brief This callback method asks the user to provide the physical
273f11c7f63SJim Harris  *        address for the supplied virtual address when building an
274f11c7f63SJim Harris  *        io request object.
275f11c7f63SJim Harris  *
276f11c7f63SJim Harris  * @param[in] controller This parameter is the core controller object
277f11c7f63SJim Harris  *            handle.
278f11c7f63SJim Harris  * @param[in] io_request This parameter is the io request object handle
279f11c7f63SJim Harris  *            for which the physical address is being requested.
280453130d9SPedro F. Giffuni  * @param[in] virtual_address This parameter is the virtual address which
281f11c7f63SJim Harris  *            is to be returned as a physical address.
282f11c7f63SJim Harris  * @param[out] physical_address The physical address for the supplied virtual
283f11c7f63SJim Harris  *        address.
284f11c7f63SJim Harris  *
285f11c7f63SJim Harris  * @return None.
286f11c7f63SJim Harris  */
287f11c7f63SJim Harris void scic_cb_io_request_get_physical_address(
288f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T   controller,
289f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T   io_request,
290f11c7f63SJim Harris    void                    * virtual_address,
291f11c7f63SJim Harris    SCI_PHYSICAL_ADDRESS    * physical_address
292f11c7f63SJim Harris );
293f11c7f63SJim Harris #endif // SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED
294f11c7f63SJim Harris 
295f11c7f63SJim Harris /**
296f11c7f63SJim Harris  * @brief This callback method asks the user to provide the number of
297453130d9SPedro F. Giffuni  *        bytes to be transferred as part of this request.
298f11c7f63SJim Harris  *
299f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
300f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
301f11c7f63SJim Harris  *            provide the necessary information for this callback.
302f11c7f63SJim Harris  *
303f11c7f63SJim Harris  * @return This method returns the number of payload data bytes to be
304453130d9SPedro F. Giffuni  *         transferred for this IO request.
305f11c7f63SJim Harris  */
306f11c7f63SJim Harris U32 scic_cb_io_request_get_transfer_length(
307f11c7f63SJim Harris    void * scic_user_io_request
308f11c7f63SJim Harris );
309f11c7f63SJim Harris 
310f11c7f63SJim Harris /**
311f11c7f63SJim Harris  * @brief This callback method asks the user to provide the data direction
312f11c7f63SJim Harris  *        for this request.
313f11c7f63SJim Harris  *
314f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
315f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
316f11c7f63SJim Harris  *            provide the necessary information for this callback.
317f11c7f63SJim Harris  *
318f11c7f63SJim Harris  * @return This method returns the value of SCI_IO_REQUEST_DATA_OUT or
319f11c7f63SJim Harris  *         SCI_IO_REQUEST_DATA_IN, or SCI_IO_REQUEST_NO_DATA.
320f11c7f63SJim Harris  */
321f11c7f63SJim Harris SCI_IO_REQUEST_DATA_DIRECTION scic_cb_io_request_get_data_direction(
322f11c7f63SJim Harris    void * scic_user_io_request
323f11c7f63SJim Harris );
324f11c7f63SJim Harris 
325f11c7f63SJim Harris #ifdef ENABLE_OSSL_COPY_BUFFER
326f11c7f63SJim Harris /**
327f11c7f63SJim Harris  * @brief This method is presently utilized in the PIO path,
328f11c7f63SJim Harris  *        copies from UF buffer to the SGL buffer. This method
329f11c7f63SJim Harris  *        can be served for other OS related copies.
330f11c7f63SJim Harris  *
331f11c7f63SJim Harris  * @param[in] scic_user_io_request. This parameter points to the user's
332f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
333f11c7f63SJim Harris  *            provide the necessary information for this callback.
334f11c7f63SJim Harris  * @param[in] source addr. Address of UF buffer.
335f11c7f63SJim Harris  * @param[in] offset. This parameter specifies the offset into the data
336f11c7f63SJim Harris  *            buffers pointed to by the SGL.  The byte offset starts at 0
337f11c7f63SJim Harris  *            and continues until the last byte pointed to be the last SGL
338f11c7f63SJim Harris  *            element.
339f11c7f63SJim Harris  * @param[in] length. data length
340f11c7f63SJim Harris  *
341f11c7f63SJim Harris  * @return    None
342f11c7f63SJim Harris  */
343f11c7f63SJim Harris void scic_cb_io_request_copy_buffer(
344f11c7f63SJim Harris    void * scic_user_io_request,
345f11c7f63SJim Harris    U8   *source_addr,
346f11c7f63SJim Harris    U32   offset,
347f11c7f63SJim Harris    U32   length
348f11c7f63SJim Harris );
349f11c7f63SJim Harris #endif
350f11c7f63SJim Harris 
351f11c7f63SJim Harris #ifndef SCI_SGL_OPTIMIZATION_ENABLED
352f11c7f63SJim Harris /**
353f11c7f63SJim Harris  * @brief This callback method asks the user to provide the address
354f11c7f63SJim Harris  *        to where the next Scatter-Gather Element is located.
355f11c7f63SJim Harris  *
356f11c7f63SJim Harris  * Details regarding usage:
357f11c7f63SJim Harris  *   - Regarding the first SGE: the user should initialize an index,
358f11c7f63SJim Harris  *     or a pointer, prior to construction of the request that will
359f11c7f63SJim Harris  *     reference the very first scatter-gather element.  This is
360f11c7f63SJim Harris  *     important since this method is called for every scatter-gather
361f11c7f63SJim Harris  *     element, including the first element.
362f11c7f63SJim Harris  *   - Regarding the last SGE: the user should return NULL from this
363f11c7f63SJim Harris  *     method when this method is called and the SGL has exhausted
364f11c7f63SJim Harris  *     all elements.
365f11c7f63SJim Harris  *
366f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
367f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
368f11c7f63SJim Harris  *            provide the necessary information for this callback.
369f11c7f63SJim Harris  * @param[in] current_sge_address This parameter specifies the address for
370f11c7f63SJim Harris  *            the current SGE (i.e. the one that has just processed).
371f11c7f63SJim Harris  * @param[out] next_sge An address specifying the location for the next
372f11c7f63SJim Harris  *            scatter gather element to be processed.
373f11c7f63SJim Harris  *
374f11c7f63SJim Harris  * @return None
375f11c7f63SJim Harris  */
376f11c7f63SJim Harris void scic_cb_io_request_get_next_sge(
377f11c7f63SJim Harris    void * scic_user_io_request,
378f11c7f63SJim Harris    void * current_sge_address,
379f11c7f63SJim Harris    void ** next_sge
380f11c7f63SJim Harris );
381f11c7f63SJim Harris #endif // SCI_SGL_OPTIMIZATION_ENABLED
382f11c7f63SJim Harris 
383f11c7f63SJim Harris /**
384f11c7f63SJim Harris  * @brief This callback method asks the user to provide the contents of the
385f11c7f63SJim Harris  *        "address" field in the Scatter-Gather Element.
386f11c7f63SJim Harris  *
387f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
388f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
389f11c7f63SJim Harris  *            provide the necessary information for this callback.
390f11c7f63SJim Harris  * @param[in] sge_address This parameter specifies the address for the
391f11c7f63SJim Harris  *            SGE from which to retrieve the address field.
392f11c7f63SJim Harris  *
393f11c7f63SJim Harris  * @return A physical address specifying the contents of the SGE's address
394f11c7f63SJim Harris  *         field.
395f11c7f63SJim Harris  */
396f11c7f63SJim Harris SCI_PHYSICAL_ADDRESS scic_cb_sge_get_address_field(
397f11c7f63SJim Harris    void * scic_user_io_request,
398f11c7f63SJim Harris    void * sge_address
399f11c7f63SJim Harris );
400f11c7f63SJim Harris 
401f11c7f63SJim Harris /**
402f11c7f63SJim Harris  * @brief This callback method asks the user to provide the contents of the
403f11c7f63SJim Harris  *        "length" field in the Scatter-Gather Element.
404f11c7f63SJim Harris  *
405f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
406f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
407f11c7f63SJim Harris  *            provide the necessary information for this callback.
408f11c7f63SJim Harris  * @param[in] sge_address This parameter specifies the address for the
409f11c7f63SJim Harris  *            SGE from which to retrieve the address field.
410f11c7f63SJim Harris  *
411f11c7f63SJim Harris  * @return This method returns the length field specified inside the SGE
412f11c7f63SJim Harris  *         referenced by the sge_address parameter.
413f11c7f63SJim Harris  */
414f11c7f63SJim Harris U32 scic_cb_sge_get_length_field(
415f11c7f63SJim Harris    void * scic_user_io_request,
416f11c7f63SJim Harris    void * sge_address
417f11c7f63SJim Harris );
418f11c7f63SJim Harris 
419f11c7f63SJim Harris /**
420f11c7f63SJim Harris  * @brief This callback method asks the user to provide the address for
421f11c7f63SJim Harris  *        the command descriptor block (CDB) associated with this IO request.
422f11c7f63SJim Harris  *
423f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
424f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
425f11c7f63SJim Harris  *            provide the necessary information for this callback.
426f11c7f63SJim Harris  *
427f11c7f63SJim Harris  * @return This method returns the virtual address of the CDB.
428f11c7f63SJim Harris  */
429f11c7f63SJim Harris void * scic_cb_ssp_io_request_get_cdb_address(
430f11c7f63SJim Harris    void * scic_user_io_request
431f11c7f63SJim Harris );
432f11c7f63SJim Harris 
433f11c7f63SJim Harris /**
434f11c7f63SJim Harris  * @brief This callback method asks the user to provide the length of
435f11c7f63SJim Harris  *        the command descriptor block (CDB) associated with this IO request.
436f11c7f63SJim Harris  *
437f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
438f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
439f11c7f63SJim Harris  *            provide the necessary information for this callback.
440f11c7f63SJim Harris  *
441f11c7f63SJim Harris  * @return This method returns the length of the CDB.
442f11c7f63SJim Harris  */
443f11c7f63SJim Harris U32 scic_cb_ssp_io_request_get_cdb_length(
444f11c7f63SJim Harris    void * scic_user_io_request
445f11c7f63SJim Harris );
446f11c7f63SJim Harris 
447f11c7f63SJim Harris /**
448f11c7f63SJim Harris  * @brief This callback method asks the user to provide the Logical Unit (LUN)
449f11c7f63SJim Harris  *        associated with this IO request.
450f11c7f63SJim Harris  *
451f11c7f63SJim Harris  * @note The contents of the value returned from this callback are defined
452f11c7f63SJim Harris  *       by the protocol standard (e.g. T10 SAS specification).  Please
453f11c7f63SJim Harris  *       refer to the transport command information unit description
454f11c7f63SJim Harris  *       in the associated standard.
455f11c7f63SJim Harris  *
456f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
457f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
458f11c7f63SJim Harris  *            provide the necessary information for this callback.
459f11c7f63SJim Harris  *
460f11c7f63SJim Harris  * @return This method returns the LUN associated with this request.
461f11c7f63SJim Harris  * @todo This should be U64?
462f11c7f63SJim Harris  */
463f11c7f63SJim Harris U32 scic_cb_ssp_io_request_get_lun(
464f11c7f63SJim Harris    void * scic_user_io_request
465f11c7f63SJim Harris );
466f11c7f63SJim Harris 
467f11c7f63SJim Harris /**
468f11c7f63SJim Harris  * @brief This callback method asks the user to provide the task attribute
469f11c7f63SJim Harris  *        associated with this IO request.
470f11c7f63SJim Harris  *
471f11c7f63SJim Harris  * @note The contents of the value returned from this callback are defined
472f11c7f63SJim Harris  *       by the protocol standard (e.g. T10 SAS specification).  Please
473f11c7f63SJim Harris  *       refer to the transport command information unit description
474f11c7f63SJim Harris  *       in the associated standard.
475f11c7f63SJim Harris  *
476f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
477f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
478f11c7f63SJim Harris  *            provide the necessary information for this callback.
479f11c7f63SJim Harris  *
480f11c7f63SJim Harris  * @return This method returns the task attribute associated with this
481f11c7f63SJim Harris  *         IO request.
482f11c7f63SJim Harris  */
483f11c7f63SJim Harris U32 scic_cb_ssp_io_request_get_task_attribute(
484f11c7f63SJim Harris    void * scic_user_io_request
485f11c7f63SJim Harris );
486f11c7f63SJim Harris 
487f11c7f63SJim Harris /**
488f11c7f63SJim Harris  * @brief This callback method asks the user to provide the command priority
489f11c7f63SJim Harris  *        associated with this IO request.
490f11c7f63SJim Harris  *
491f11c7f63SJim Harris  * @note The contents of the value returned from this callback are defined
492f11c7f63SJim Harris  *       by the protocol standard (e.g. T10 SAS specification).  Please
493f11c7f63SJim Harris  *       refer to the transport command information unit description
494f11c7f63SJim Harris  *       in the associated standard.
495f11c7f63SJim Harris  *
496f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's
497f11c7f63SJim Harris  *            IO request object.  It is a cookie that allows the user to
498f11c7f63SJim Harris  *            provide the necessary information for this callback.
499f11c7f63SJim Harris  *
500f11c7f63SJim Harris  * @return This method returns the command priority associated with this
501f11c7f63SJim Harris  *         IO request.
502f11c7f63SJim Harris  */
503f11c7f63SJim Harris U32 scic_cb_ssp_io_request_get_command_priority(
504f11c7f63SJim Harris    void * scic_user_io_request
505f11c7f63SJim Harris );
506f11c7f63SJim Harris 
507f11c7f63SJim Harris /**
508f11c7f63SJim Harris  * @brief This callback method asks the user if the received RX frame data is
509f11c7f63SJim Harris  *        to be copied to the SGL or should be stored by the SCI core to be
510f11c7f63SJim Harris  *        retrieved later with the scic_io_request_get_rx_frame().
511f11c7f63SJim Harris  *
512f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's IO
513f11c7f63SJim Harris  *       request object.  It is a cookie that allows the user to provide the
514f11c7f63SJim Harris  *       necessary information for this callback.
515f11c7f63SJim Harris  *
516f11c7f63SJim Harris  * @return This method returns TRUE if the SCI core should copy the received
517f11c7f63SJim Harris  *         frame data to the SGL location or FALSE if the SCI user wants to
518f11c7f63SJim Harris  *         retrieve the frame data at a later time.
519f11c7f63SJim Harris  */
520f11c7f63SJim Harris BOOL scic_cb_io_request_do_copy_rx_frames(
521f11c7f63SJim Harris    void * scic_user_io_request
522f11c7f63SJim Harris );
523f11c7f63SJim Harris 
524f11c7f63SJim Harris /**
525f11c7f63SJim Harris  * @brief This callback method asks the user to return the SAT protocol
526f11c7f63SJim Harris  *        definition for this IO request.  This method is only called by the
527f11c7f63SJim Harris  *        SCI core if the request type constructed is SATA.
528f11c7f63SJim Harris  *
529f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's IO
530f11c7f63SJim Harris  *       request object.  It is a cookie that allows the user to provide the
531f11c7f63SJim Harris  *       necessary information for this callback.
532f11c7f63SJim Harris  *
533f11c7f63SJim Harris  * @return This method returns one of the sat.h defined protocols for the
534f11c7f63SJim Harris  *         given io request.
535f11c7f63SJim Harris  */
536f11c7f63SJim Harris U8 scic_cb_request_get_sat_protocol(
537f11c7f63SJim Harris    void * scic_user_io_request
538f11c7f63SJim Harris );
539f11c7f63SJim Harris 
540f11c7f63SJim Harris /**
541f11c7f63SJim Harris  * @brief This callback method asks the user to indicate if the IO is initially
542f11c7f63SJim Harris  *           constructed or is reconstructed using the recycled memory.
543f11c7f63SJim Harris  *
544f11c7f63SJim Harris  * @param[in] scic_user_io_request This parameter points to the user's IO
545f11c7f63SJim Harris  *       request object.  It is a cookie that allows the user to provide the
546f11c7f63SJim Harris  *       necessary information for this callback.
547f11c7f63SJim Harris  *
548f11c7f63SJim Harris  * @return This method returns TRUE if the request is initial constructed.
549f11c7f63SJim Harris  *         This method returns FALSE if the request is constructed using recycled
550f11c7f63SJim Harris  *         memory. For many scic user, this method mostly always returns TRUE.
551f11c7f63SJim Harris  */
552f11c7f63SJim Harris BOOL scic_cb_request_is_initial_construction(
553f11c7f63SJim Harris    void * scic_user_io_request
554f11c7f63SJim Harris );
555f11c7f63SJim Harris 
556f11c7f63SJim Harris /**
557f11c7f63SJim Harris  * @brief This method returns the Logical Unit to be utilized for this
558f11c7f63SJim Harris  *        task management request.
559f11c7f63SJim Harris  *
560f11c7f63SJim Harris  * @note The contents of the value returned from this callback are defined
561f11c7f63SJim Harris  *       by the protocol standard (e.g. T10 SAS specification).  Please
562f11c7f63SJim Harris  *       refer to the transport task information unit description
563f11c7f63SJim Harris  *       in the associated standard.
564f11c7f63SJim Harris  *
565f11c7f63SJim Harris  * @param[in] scic_user_task_request This parameter points to the user's
566f11c7f63SJim Harris  *            task request object.  It is a cookie that allows the user to
567f11c7f63SJim Harris  *            provide the necessary information for this callback.
568f11c7f63SJim Harris  *
569f11c7f63SJim Harris  * @return This method returns the LUN associated with this request.
570f11c7f63SJim Harris  * @todo This should be U64?
571f11c7f63SJim Harris  */
572f11c7f63SJim Harris U32 scic_cb_ssp_task_request_get_lun(
573f11c7f63SJim Harris    void * scic_user_task_request
574f11c7f63SJim Harris );
575f11c7f63SJim Harris 
576f11c7f63SJim Harris /**
577f11c7f63SJim Harris  * @brief This method returns the task management function to be utilized
578f11c7f63SJim Harris  *        for this task request.
579f11c7f63SJim Harris  *
580f11c7f63SJim Harris  * @note The contents of the value returned from this callback are defined
581f11c7f63SJim Harris  *       by the protocol standard (e.g. T10 SAS specification).  Please
582f11c7f63SJim Harris  *       refer to the transport task information unit description
583f11c7f63SJim Harris  *       in the associated standard.
584f11c7f63SJim Harris  *
585f11c7f63SJim Harris  * @param[in] scic_user_task_request This parameter points to the user's
586f11c7f63SJim Harris  *            task request object.  It is a cookie that allows the user to
587f11c7f63SJim Harris  *            provide the necessary information for this callback.
588f11c7f63SJim Harris  *
589f11c7f63SJim Harris  * @return This method returns an unsigned byte representing the task
590f11c7f63SJim Harris  *         management function to be performed.
591f11c7f63SJim Harris  */
592f11c7f63SJim Harris U8 scic_cb_ssp_task_request_get_function(
593f11c7f63SJim Harris    void * scic_user_task_request
594f11c7f63SJim Harris );
595f11c7f63SJim Harris 
596f11c7f63SJim Harris /**
597f11c7f63SJim Harris  * @brief This method returns the task management IO tag to be managed.
598f11c7f63SJim Harris  *        Depending upon the task management function the value returned
599f11c7f63SJim Harris  *        from this method may be ignored.
600f11c7f63SJim Harris  *
601f11c7f63SJim Harris  * @param[in] scic_user_task_request This parameter points to the user's
602f11c7f63SJim Harris  *            task request object.  It is a cookie that allows the user to
603f11c7f63SJim Harris  *            provide the necessary information for this callback.
604f11c7f63SJim Harris  *
605f11c7f63SJim Harris  * @return This method returns an unsigned 16-bit word depicting the IO
606f11c7f63SJim Harris  *         tag to be managed.
607f11c7f63SJim Harris  */
608f11c7f63SJim Harris U16 scic_cb_ssp_task_request_get_io_tag_to_manage(
609f11c7f63SJim Harris    void * scic_user_task_request
610f11c7f63SJim Harris );
611f11c7f63SJim Harris 
612f11c7f63SJim Harris /**
613f11c7f63SJim Harris  * @brief This callback method asks the user to provide the virtual
614f11c7f63SJim Harris  *        address of the response data buffer for the supplied IO request.
615f11c7f63SJim Harris  *
616f11c7f63SJim Harris  * @param[in] scic_user_task_request This parameter points to the user's
617f11c7f63SJim Harris  *            task request object.  It is a cookie that allows the user to
618f11c7f63SJim Harris  *            provide the necessary information for this callback.
619f11c7f63SJim Harris  *
620f11c7f63SJim Harris  * @return This method returns the virtual address for the response data buffer
621f11c7f63SJim Harris  *         associated with this IO request.
622f11c7f63SJim Harris  */
623f11c7f63SJim Harris void * scic_cb_ssp_task_request_get_response_data_address(
624f11c7f63SJim Harris    void * scic_user_task_request
625f11c7f63SJim Harris );
626f11c7f63SJim Harris 
627f11c7f63SJim Harris /**
628f11c7f63SJim Harris  * @brief This callback method asks the user to provide the length of the
629f11c7f63SJim Harris  *        response data buffer for the supplied IO request.
630f11c7f63SJim Harris  *
631f11c7f63SJim Harris  * @param[in] scic_user_task_request This parameter points to the user's
632f11c7f63SJim Harris  *            task request object.  It is a cookie that allows the user to
633f11c7f63SJim Harris  *            provide the necessary information for this callback.
634f11c7f63SJim Harris  *
635f11c7f63SJim Harris  * @return This method returns the length of the response buffer data
636f11c7f63SJim Harris  *         associated with this IO request.
637f11c7f63SJim Harris  */
638f11c7f63SJim Harris U32 scic_cb_ssp_task_request_get_response_data_length(
639f11c7f63SJim Harris    void * scic_user_task_request
640f11c7f63SJim Harris );
641f11c7f63SJim Harris 
642f11c7f63SJim Harris /**
643f11c7f63SJim Harris  * @brief In this method the user is expected to log the supplied
644f11c7f63SJim Harris  *        error information.  The user must be capable of handling variable
645f11c7f63SJim Harris  *        length argument lists and should consider prepending the fact
646f11c7f63SJim Harris  *        that this is an error from the core.
647f11c7f63SJim Harris  *
648f11c7f63SJim Harris  * @param[in]  logger_object This parameter specifies the logger object
649f11c7f63SJim Harris  *             associated with this message.
650f11c7f63SJim Harris  * @param[in]  log_object_mask This parameter specifies the log objects
651f11c7f63SJim Harris  *             for which this message is being generated.
652f11c7f63SJim Harris  * @param[in]  log_message This parameter specifies the message to be logged.
653f11c7f63SJim Harris  *
654f11c7f63SJim Harris  * @return none
655f11c7f63SJim Harris  */
656f11c7f63SJim Harris void scic_cb_logger_log_error(
657f11c7f63SJim Harris    SCI_LOGGER_HANDLE_T   logger_object,
658f11c7f63SJim Harris    U32                   log_object_mask,
659f11c7f63SJim Harris    char                * log_message,
660f11c7f63SJim Harris    ...
661f11c7f63SJim Harris );
662f11c7f63SJim Harris 
663f11c7f63SJim Harris 
664f11c7f63SJim Harris /**
665f11c7f63SJim Harris  * @brief In this method the user is expected to log the supplied warning
666f11c7f63SJim Harris  *        information.  The user must be capable of handling variable
667f11c7f63SJim Harris  *        length argument lists and should consider prepending the fact
668f11c7f63SJim Harris  *        that this is a warning from the core.
669f11c7f63SJim Harris  *
670f11c7f63SJim Harris  * @param[in]  logger_object This parameter specifies the logger object
671f11c7f63SJim Harris  *             associated with this message.
672f11c7f63SJim Harris  * @param[in]  log_object_mask This parameter specifies the log objects
673f11c7f63SJim Harris  *             for which this message is being generated.
674f11c7f63SJim Harris  * @param[in]  log_message This parameter specifies the message to be logged.
675f11c7f63SJim Harris  *
676f11c7f63SJim Harris  * @return none
677f11c7f63SJim Harris  */
678f11c7f63SJim Harris void scic_cb_logger_log_warning(
679f11c7f63SJim Harris    SCI_LOGGER_HANDLE_T   logger_object,
680f11c7f63SJim Harris    U32                   log_object_mask,
681f11c7f63SJim Harris    char                * log_message,
682f11c7f63SJim Harris    ...
683f11c7f63SJim Harris );
684f11c7f63SJim Harris 
685f11c7f63SJim Harris 
686f11c7f63SJim Harris /**
687f11c7f63SJim Harris  * @brief In this method the user is expected to log the supplied debug
688f11c7f63SJim Harris  *        information.  The user must be capable of handling variable
689f11c7f63SJim Harris  *        length argument lists and should consider prepending the fact
690f11c7f63SJim Harris  *        that this is a debug message from the core.
691f11c7f63SJim Harris  *
692f11c7f63SJim Harris  * @param[in]  logger_object This parameter specifies the logger object
693f11c7f63SJim Harris  *             associated with this message.
694f11c7f63SJim Harris  * @param[in]  log_object_mask This parameter specifies the log objects
695f11c7f63SJim Harris  *             for which this message is being generated.
696f11c7f63SJim Harris  * @param[in]  log_message This parameter specifies the message to be logged.
697f11c7f63SJim Harris  *
698f11c7f63SJim Harris  * @return none
699f11c7f63SJim Harris  */
700f11c7f63SJim Harris void scic_cb_logger_log_info(
701f11c7f63SJim Harris    SCI_LOGGER_HANDLE_T   logger_object,
702f11c7f63SJim Harris    U32                   log_object_mask,
703f11c7f63SJim Harris    char                * log_message,
704f11c7f63SJim Harris    ...
705f11c7f63SJim Harris );
706f11c7f63SJim Harris 
707f11c7f63SJim Harris 
708f11c7f63SJim Harris /**
709f11c7f63SJim Harris  * @brief In this method the user is expected to log the supplied function
710f11c7f63SJim Harris  *        trace information.  The user must be capable of handling variable
711f11c7f63SJim Harris  *        length argument lists and should consider prepending the fact
712f11c7f63SJim Harris  *        that this is a function trace (i.e. entry/exit) message from the
713f11c7f63SJim Harris  *        core.
714f11c7f63SJim Harris  *
715f11c7f63SJim Harris  * @param[in]  logger_object This parameter specifies the logger object
716f11c7f63SJim Harris  *             associated with this message.
717f11c7f63SJim Harris  * @param[in]  log_object_mask This parameter specifies the log objects
718f11c7f63SJim Harris  *             for which this message is being generated.
719f11c7f63SJim Harris  * @param[in]  log_message This parameter specifies the message to be logged.
720f11c7f63SJim Harris  *
721f11c7f63SJim Harris  * @return none
722f11c7f63SJim Harris  */
723f11c7f63SJim Harris void scic_cb_logger_log_trace(
724f11c7f63SJim Harris    SCI_LOGGER_HANDLE_T   logger_object,
725f11c7f63SJim Harris    U32                   log_object_mask,
726f11c7f63SJim Harris    char                * log_message,
727f11c7f63SJim Harris    ...
728f11c7f63SJim Harris );
729f11c7f63SJim Harris 
730f11c7f63SJim Harris 
731f11c7f63SJim Harris /**
732f11c7f63SJim Harris  * @brief In this method the user is expected to log the supplied state
733f11c7f63SJim Harris  *        transition information. The user must be capable of handling
734f11c7f63SJim Harris  *        variable length argument lists and should consider prepending the
735f11c7f63SJim Harris  *        fact that this is a warning from the core.
736f11c7f63SJim Harris  *
737f11c7f63SJim Harris  * @param[in]  logger_object This parameter specifies the logger object
738f11c7f63SJim Harris  *             associated with this message.
739f11c7f63SJim Harris  * @param[in]  log_object_mask This parameter specifies the log objects
740f11c7f63SJim Harris  *             for which this message is being generated.
741f11c7f63SJim Harris  * @param[in]  log_message This parameter specifies the message to be logged.
742f11c7f63SJim Harris  *
743f11c7f63SJim Harris  * @return none
744f11c7f63SJim Harris  */
745f11c7f63SJim Harris void scic_cb_logger_log_states(
746f11c7f63SJim Harris    SCI_LOGGER_HANDLE_T   logger_object,
747f11c7f63SJim Harris    U32                   log_object_mask,
748f11c7f63SJim Harris    char                * log_message,
749f11c7f63SJim Harris    ...
750f11c7f63SJim Harris );
751f11c7f63SJim Harris 
752f11c7f63SJim Harris 
753f11c7f63SJim Harris /**
754f11c7f63SJim Harris  * @brief In this method the user must return the base address register (BAR)
755f11c7f63SJim Harris  *        value for the supplied base address register number.
756f11c7f63SJim Harris  *
757f11c7f63SJim Harris  * @param[in] controller The controller for which to retrieve the bar number.
758f11c7f63SJim Harris  * @param[in] bar_number This parameter depicts the BAR index/number to be read.
759f11c7f63SJim Harris  *
760f11c7f63SJim Harris  * @return Return a pointer value indicating the contents of the BAR.
761f11c7f63SJim Harris  * @retval NULL indicates an invalid BAR index/number was specified.
762f11c7f63SJim Harris  * @retval All other values indicate a valid VIRTUAL address from the BAR.
763f11c7f63SJim Harris  */
764f11c7f63SJim Harris void * scic_cb_pci_get_bar(
765f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
766f11c7f63SJim Harris    U16                      bar_number
767f11c7f63SJim Harris );
768f11c7f63SJim Harris 
769f11c7f63SJim Harris /**
770f11c7f63SJim Harris  * @brief In this method the user must read from PCI memory via access.
771f11c7f63SJim Harris  *        This method is used for access to memory space and IO space.
772f11c7f63SJim Harris  *
773f11c7f63SJim Harris  * @param[in]  controller The controller for which to read a DWORD.
774f11c7f63SJim Harris  * @param[in]  address This parameter depicts the address from
775f11c7f63SJim Harris  *             which to read.
776f11c7f63SJim Harris  *
777f11c7f63SJim Harris  * @return The value being returned from the PCI memory location.
778f11c7f63SJim Harris  *
779f11c7f63SJim Harris  * @todo This PCI memory access calls likely need to be optimized into macro?
780f11c7f63SJim Harris  */
781f11c7f63SJim Harris U32 scic_cb_pci_read_dword(
782f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T   controller,
783f11c7f63SJim Harris    void                    * address
784f11c7f63SJim Harris );
785f11c7f63SJim Harris 
786f11c7f63SJim Harris /**
787f11c7f63SJim Harris  * @brief In this method the user must write to PCI memory via access.
788f11c7f63SJim Harris  *        This method is used for access to memory space and IO space.
789f11c7f63SJim Harris  *
790f11c7f63SJim Harris  * @param[in]  controller The controller for which to read a DWORD.
791f11c7f63SJim Harris  * @param[in]  address This parameter depicts the address into
792f11c7f63SJim Harris  *             which to write.
793f11c7f63SJim Harris  * @param[out] write_value This parameter depicts the value being written
794f11c7f63SJim Harris  *             into the PCI memory location.
795f11c7f63SJim Harris  *
796f11c7f63SJim Harris  * @todo This PCI memory access calls likely need to be optimized into macro?
797f11c7f63SJim Harris  */
798f11c7f63SJim Harris void scic_cb_pci_write_dword(
799f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T   controller,
800f11c7f63SJim Harris    void                    * address,
801f11c7f63SJim Harris    U32                       write_value
802f11c7f63SJim Harris );
803f11c7f63SJim Harris 
804f11c7f63SJim Harris /**
805f11c7f63SJim Harris  * @brief This method informs the user when a stop operation on the port
806f11c7f63SJim Harris  *        has completed.
807f11c7f63SJim Harris  *
808f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
809f11c7f63SJim Harris  *            contains the port.
810f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
811f11c7f63SJim Harris  *            the callback is being invoked.
812f11c7f63SJim Harris  * @param[in] completion_status This parameter specifies the status for
813f11c7f63SJim Harris  *            the operation being completed.
814f11c7f63SJim Harris  *
815f11c7f63SJim Harris  * @return none
816f11c7f63SJim Harris  */
817f11c7f63SJim Harris void scic_cb_port_stop_complete(
818f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
819f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
820f11c7f63SJim Harris    SCI_STATUS               completion_status
821f11c7f63SJim Harris );
822f11c7f63SJim Harris 
823f11c7f63SJim Harris /**
824f11c7f63SJim Harris  * @brief This method informs the user when a hard reset on the port
825f11c7f63SJim Harris  *        has completed.  This hard reset could have been initiated by the
826f11c7f63SJim Harris  *        user or by the remote port.
827f11c7f63SJim Harris  *
828f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
829f11c7f63SJim Harris  *            contains the port.
830f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
831f11c7f63SJim Harris  *            the callback is being invoked.
832f11c7f63SJim Harris  * @param[in] completion_status This parameter specifies the status for
833f11c7f63SJim Harris  *            the operation being completed.
834f11c7f63SJim Harris  *
835f11c7f63SJim Harris  * @return none
836f11c7f63SJim Harris  */
837f11c7f63SJim Harris void scic_cb_port_hard_reset_complete(
838f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
839f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
840f11c7f63SJim Harris    SCI_STATUS               completion_status
841f11c7f63SJim Harris );
842f11c7f63SJim Harris 
843f11c7f63SJim Harris /**
844f11c7f63SJim Harris  * @brief This method informs the user that the port is now in a ready
845f11c7f63SJim Harris  *        state and can be utilized to issue IOs.
846f11c7f63SJim Harris  *
847f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
848f11c7f63SJim Harris  *            contains the port.
849f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
850f11c7f63SJim Harris  *            the callback is being invoked.
851f11c7f63SJim Harris  *
852f11c7f63SJim Harris  * @return none
853f11c7f63SJim Harris  */
854f11c7f63SJim Harris void scic_cb_port_ready(
855f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
856f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port
857f11c7f63SJim Harris );
858f11c7f63SJim Harris 
859f11c7f63SJim Harris /**
860f11c7f63SJim Harris  * @brief This method informs the user that the port is now not in a ready
861f11c7f63SJim Harris  *        (i.e. busy) state and can't be utilized to issue IOs.
862f11c7f63SJim Harris  *
863f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
864f11c7f63SJim Harris  *            contains the port.
865f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
866f11c7f63SJim Harris  *            the callback is being invoked.
867f11c7f63SJim Harris  * @param[in] reason_code This parameter specifies the reason for the port
868f11c7f63SJim Harris  *            not ready callback.
869f11c7f63SJim Harris  *
870f11c7f63SJim Harris  * @return none
871f11c7f63SJim Harris  */
872f11c7f63SJim Harris void scic_cb_port_not_ready(
873f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
874f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
875f11c7f63SJim Harris    U32                      reason_code
876f11c7f63SJim Harris );
877f11c7f63SJim Harris 
878f11c7f63SJim Harris /**
879f11c7f63SJim Harris  * @brief This method informs the SCI Core user that a phy/link became
880f11c7f63SJim Harris  *        ready, but the phy is not allowed in the port.  In some
881f11c7f63SJim Harris  *        situations the underlying hardware only allows for certain phy
882f11c7f63SJim Harris  *        to port mappings.  If these mappings are violated, then this
883f11c7f63SJim Harris  *        API is invoked.
884f11c7f63SJim Harris  *
885f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
886f11c7f63SJim Harris  *            contains the port.
887f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
888f11c7f63SJim Harris  *            the callback is being invoked.
889f11c7f63SJim Harris  * @param[in] phy This parameter specifies the phy that came ready, but the
890f11c7f63SJim Harris  *            phy can't be a valid member of the port.
891f11c7f63SJim Harris  *
892f11c7f63SJim Harris  * @return none
893f11c7f63SJim Harris  */
894f11c7f63SJim Harris void scic_cb_port_invalid_link_up(
895f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
896f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
897f11c7f63SJim Harris    SCI_PHY_HANDLE_T         phy
898f11c7f63SJim Harris );
899f11c7f63SJim Harris 
900f11c7f63SJim Harris /**
901f11c7f63SJim Harris  * @brief This callback method informs the user that a broadcast change
902f11c7f63SJim Harris  *        primitive was received.
903f11c7f63SJim Harris  *
904f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
905f11c7f63SJim Harris  *            contains the port.
906f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
907f11c7f63SJim Harris  *            the callback is being invoked.  For instances where the phy
908f11c7f63SJim Harris  *            on which the primitive was received is not part of a port, this
909f11c7f63SJim Harris  *            parameter will be SCI_INVALID_HANDLE_T.
910f11c7f63SJim Harris  * @param[in] phy This parameter specifies the phy on which the primitive
911f11c7f63SJim Harris  *            was received.
912f11c7f63SJim Harris  *
913f11c7f63SJim Harris  * @return none
914f11c7f63SJim Harris  */
915f11c7f63SJim Harris void scic_cb_port_bc_change_primitive_recieved(
916f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
917f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
918f11c7f63SJim Harris    SCI_PHY_HANDLE_T         phy
919f11c7f63SJim Harris );
920f11c7f63SJim Harris 
921f11c7f63SJim Harris /**
922f11c7f63SJim Harris  * @brief This callback method informs the user that a broadcast SES
923f11c7f63SJim Harris  *        primitive was received.
924f11c7f63SJim Harris  *
925f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
926f11c7f63SJim Harris  *            contains the port.
927f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
928f11c7f63SJim Harris  *            the callback is being invoked.  For instances where the phy
929f11c7f63SJim Harris  *            on which the primitive was received is not part of a port, this
930f11c7f63SJim Harris  *            parameter will be SCI_INVALID_HANDLE_T.
931f11c7f63SJim Harris  * @param[in] phy This parameter specifies the phy on which the primitive
932f11c7f63SJim Harris  *            was received.
933f11c7f63SJim Harris  *
934f11c7f63SJim Harris  * @return none
935f11c7f63SJim Harris  */
936f11c7f63SJim Harris void scic_cb_port_bc_ses_primitive_recieved(
937f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
938f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
939f11c7f63SJim Harris    SCI_PHY_HANDLE_T         phy
940f11c7f63SJim Harris );
941f11c7f63SJim Harris 
942f11c7f63SJim Harris /**
943f11c7f63SJim Harris  * @brief This callback method informs the user that a broadcast EXPANDER
944f11c7f63SJim Harris  *        primitive was received.
945f11c7f63SJim Harris  *
946f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
947f11c7f63SJim Harris  *            contains the port.
948f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
949f11c7f63SJim Harris  *            the callback is being invoked.  For instances where the phy
950f11c7f63SJim Harris  *            on which the primitive was received is not part of a port, this
951f11c7f63SJim Harris  *            parameter will be SCI_INVALID_HANDLE_T.
952f11c7f63SJim Harris  * @param[in] phy This parameter specifies the phy on which the primitive
953f11c7f63SJim Harris  *            was received.
954f11c7f63SJim Harris  *
955f11c7f63SJim Harris  * @return none
956f11c7f63SJim Harris  */
957f11c7f63SJim Harris void scic_cb_port_bc_expander_primitive_recieved(
958f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
959f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
960f11c7f63SJim Harris    SCI_PHY_HANDLE_T         phy
961f11c7f63SJim Harris );
962f11c7f63SJim Harris 
963f11c7f63SJim Harris /**
964f11c7f63SJim Harris  * @brief This callback method informs the user that a broadcast ASYNCHRONOUS
965f11c7f63SJim Harris  *        EVENT (AEN) primitive was received.
966f11c7f63SJim Harris  *
967f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller which
968f11c7f63SJim Harris  *            contains the port.
969f11c7f63SJim Harris  * @param[in] port This parameter specifies the SCI port object for which
970f11c7f63SJim Harris  *            the callback is being invoked.  For instances where the phy
971f11c7f63SJim Harris  *            on which the primitive was received is not part of a port, this
972f11c7f63SJim Harris  *            parameter will be SCI_INVALID_HANDLE_T.
973f11c7f63SJim Harris  * @param[in] phy This parameter specifies the phy on which the primitive
974f11c7f63SJim Harris  *            was received.
975f11c7f63SJim Harris  *
976f11c7f63SJim Harris  * @return none
977f11c7f63SJim Harris  */
978f11c7f63SJim Harris void scic_cb_port_bc_aen_primitive_recieved(
979f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
980f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
981f11c7f63SJim Harris    SCI_PHY_HANDLE_T         phy
982f11c7f63SJim Harris );
983f11c7f63SJim Harris 
984f11c7f63SJim Harris /**
985f11c7f63SJim Harris  * @brief This callback method informs the user that a phy has become
986f11c7f63SJim Harris  *        operational and is capable of communicating with the remote end
987f11c7f63SJim Harris  *        point.
988f11c7f63SJim Harris  *
989f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller
990f11c7f63SJim Harris  *            associated with the phy.
991f11c7f63SJim Harris  * @param[in] port This parameter specifies the port object for which the
992f11c7f63SJim Harris  *            user callback is being invoked.  There may be conditions where
993f11c7f63SJim Harris  *            this parameter can be SCI_INVALID_HANDLE
994f11c7f63SJim Harris  * @param[in] phy This parameter specifies the phy object for which the
995f11c7f63SJim Harris  *            user callback is being invoked.
996f11c7f63SJim Harris  *
997f11c7f63SJim Harris  * @return none
998f11c7f63SJim Harris  */
999f11c7f63SJim Harris void scic_cb_port_link_up(
1000f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
1001f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
1002f11c7f63SJim Harris    SCI_PHY_HANDLE_T         phy
1003f11c7f63SJim Harris );
1004f11c7f63SJim Harris 
1005f11c7f63SJim Harris /**
1006f11c7f63SJim Harris  * @brief This callback method informs the user that a phy is no longer
1007f11c7f63SJim Harris  *        operational and is not capable of communicating with the remote end
1008f11c7f63SJim Harris  *        point.
1009f11c7f63SJim Harris  *
1010f11c7f63SJim Harris  * @param[in] controller This parameter represents the controller
1011f11c7f63SJim Harris  *            associated with the phy.
1012f11c7f63SJim Harris  * @param[in] port This parameter specifies the port object for which the
1013f11c7f63SJim Harris  *            user callback is being invoked.  There may be conditions where
1014f11c7f63SJim Harris  *            this parameter can be SCI_INVALID_HANDLE
1015f11c7f63SJim Harris  * @param[in] phy This parameter specifies the phy object for which the
1016f11c7f63SJim Harris  *            user callback is being invoked.
1017f11c7f63SJim Harris  *
1018f11c7f63SJim Harris  * @return none
1019f11c7f63SJim Harris  */
1020f11c7f63SJim Harris void scic_cb_port_link_down(
1021f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T  controller,
1022f11c7f63SJim Harris    SCI_PORT_HANDLE_T        port,
1023f11c7f63SJim Harris    SCI_PHY_HANDLE_T         phy
1024f11c7f63SJim Harris );
1025f11c7f63SJim Harris 
1026f11c7f63SJim Harris /**
1027f11c7f63SJim Harris  * @brief This user callback method will inform the user that a start
1028f11c7f63SJim Harris  *        operation has completed.
1029f11c7f63SJim Harris  *
1030f11c7f63SJim Harris  * @param[in] controller This parameter specifies the core controller
1031f11c7f63SJim Harris  *            associated with the completion callback.
1032f11c7f63SJim Harris  * @param[in] remote_device This parameter specifies the remote device
1033f11c7f63SJim Harris  *            associated with the completion callback.
1034f11c7f63SJim Harris  * @param[in] completion_status This parameter specifies the completion
1035f11c7f63SJim Harris  *            status for the operation.
1036f11c7f63SJim Harris  *
1037f11c7f63SJim Harris  * @return none
1038f11c7f63SJim Harris  */
1039f11c7f63SJim Harris void scic_cb_remote_device_start_complete(
1040f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T    controller,
1041f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T remote_device,
1042f11c7f63SJim Harris    SCI_STATUS                 completion_status
1043f11c7f63SJim Harris );
1044f11c7f63SJim Harris 
1045f11c7f63SJim Harris /**
1046f11c7f63SJim Harris  * @brief This user callback method will inform the user that a stop
1047f11c7f63SJim Harris  *        operation has completed.
1048f11c7f63SJim Harris  *
1049f11c7f63SJim Harris  * @param[in] controller This parameter specifies the core controller
1050f11c7f63SJim Harris  *            associated with the completion callback.
1051f11c7f63SJim Harris  * @param[in] remote_device This parameter specifies the remote device
1052f11c7f63SJim Harris  *            associated with the completion callback.
1053f11c7f63SJim Harris  * @param[in] completion_status This parameter specifies the completion
1054f11c7f63SJim Harris  *            status for the operation.
1055f11c7f63SJim Harris  *
1056f11c7f63SJim Harris  * @return none
1057f11c7f63SJim Harris  */
1058f11c7f63SJim Harris void scic_cb_remote_device_stop_complete(
1059f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T    controller,
1060f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T remote_device,
1061f11c7f63SJim Harris    SCI_STATUS                 completion_status
1062f11c7f63SJim Harris );
1063f11c7f63SJim Harris 
1064f11c7f63SJim Harris /**
1065f11c7f63SJim Harris  * @brief This user callback method will inform the user that a remote
1066f11c7f63SJim Harris  *        device is now capable of handling IO requests.
1067f11c7f63SJim Harris  *
1068f11c7f63SJim Harris  * @param[in] controller This parameter specifies the core controller
1069f11c7f63SJim Harris  *            associated with the completion callback.
1070f11c7f63SJim Harris  * @param[in] remote_device This parameter specifies the remote device
1071f11c7f63SJim Harris  *            associated with the callback.
1072f11c7f63SJim Harris  *
1073f11c7f63SJim Harris  * @return none
1074f11c7f63SJim Harris  */
1075f11c7f63SJim Harris void scic_cb_remote_device_ready(
1076f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T     controller,
1077f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
1078f11c7f63SJim Harris );
1079f11c7f63SJim Harris 
1080f11c7f63SJim Harris /**
1081f11c7f63SJim Harris  * @brief This user callback method will inform the user that a remote
1082f11c7f63SJim Harris  *        device is no longer capable of handling IO requests (until a
1083f11c7f63SJim Harris  *        ready callback is invoked).
1084f11c7f63SJim Harris  *
1085f11c7f63SJim Harris  * @param[in] controller This parameter specifies the core controller
1086f11c7f63SJim Harris  *            associated with the completion callback.
1087f11c7f63SJim Harris  * @param[in] remote_device This parameter specifies the remote device
1088f11c7f63SJim Harris  *            associated with the callback.
1089f11c7f63SJim Harris  * @param[in] reason_code This paramete specifies the reason the remote
1090f11c7f63SJim Harris  *            device is not ready.
1091f11c7f63SJim Harris  *
1092f11c7f63SJim Harris  * @return none
1093f11c7f63SJim Harris  */
1094f11c7f63SJim Harris void scic_cb_remote_device_not_ready(
1095f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T     controller,
1096f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
1097f11c7f63SJim Harris    U32                         reason_code
1098f11c7f63SJim Harris );
1099f11c7f63SJim Harris 
1100f11c7f63SJim Harris 
1101f11c7f63SJim Harris /**
1102f11c7f63SJim Harris  * @brief This user callback method will inform the user that this controller
1103f11c7f63SJim Harris  *        is having unexpected error. The user can choose to reset the controller.
1104f11c7f63SJim Harris  * @param[in] controller The controller that is failed at the moment.
1105f11c7f63SJim Harris  *
1106f11c7f63SJim Harris  * @return none
1107f11c7f63SJim Harris  */
1108f11c7f63SJim Harris void scic_cb_controller_error(
1109f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T     controller,
1110f11c7f63SJim Harris    SCI_CONTROLLER_ERROR        error
1111f11c7f63SJim Harris );
1112f11c7f63SJim Harris 
1113f11c7f63SJim Harris 
1114f11c7f63SJim Harris #if !defined(DISABLE_ATAPI)
1115f11c7f63SJim Harris /**
1116f11c7f63SJim Harris  * @brief This user callback gets from stp packet io's user request
1117f11c7f63SJim Harris  *           the CDB address.
1118f11c7f63SJim Harris  * @param[in] scic_user_io_request
1119f11c7f63SJim Harris  *
1120453130d9SPedro F. Giffuni  * @return The cdb address.
1121f11c7f63SJim Harris  */
1122f11c7f63SJim Harris void * scic_cb_stp_packet_io_request_get_cdb_address(
1123f11c7f63SJim Harris    void * scic_user_io_request
1124f11c7f63SJim Harris );
1125f11c7f63SJim Harris 
1126f11c7f63SJim Harris /**
1127f11c7f63SJim Harris  * @brief This user callback gets from stp packet io's user request
1128f11c7f63SJim Harris  *           the CDB length.
1129f11c7f63SJim Harris  * @param[in] scic_user_io_request
1130f11c7f63SJim Harris  *
1131f11c7f63SJim Harris  * @return The cdb length.
1132f11c7f63SJim Harris  */
1133f11c7f63SJim Harris U32 scic_cb_stp_packet_io_request_get_cdb_length(
1134f11c7f63SJim Harris    void * scic_user_io_request
1135f11c7f63SJim Harris );
1136f11c7f63SJim Harris #else //!defined(DISABLE_ATAPI)
1137f11c7f63SJim Harris #define scic_cb_stp_packet_io_request_get_cdb_address(scic_user_io_request) NULL
1138f11c7f63SJim Harris #define scic_cb_stp_packet_io_request_get_cdb_length(scic_user_io_request) 0
1139f11c7f63SJim Harris #endif //!defined(DISABLE_ATAPI)
1140f11c7f63SJim Harris 
1141f11c7f63SJim Harris #ifdef __cplusplus
1142f11c7f63SJim Harris }
1143f11c7f63SJim Harris #endif // __cplusplus
1144f11c7f63SJim Harris 
1145f11c7f63SJim Harris #endif // _SCIC_USER_CALLBACK_H_
1146f11c7f63SJim Harris 
1147