1230557Sjimharris/*-
2230557Sjimharris * This file is provided under a dual BSD/GPLv2 license.  When using or
3230557Sjimharris * redistributing this file, you may do so under either license.
4230557Sjimharris *
5230557Sjimharris * GPL LICENSE SUMMARY
6230557Sjimharris *
7230557Sjimharris * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8230557Sjimharris *
9230557Sjimharris * This program is free software; you can redistribute it and/or modify
10230557Sjimharris * it under the terms of version 2 of the GNU General Public License as
11230557Sjimharris * published by the Free Software Foundation.
12230557Sjimharris *
13230557Sjimharris * This program is distributed in the hope that it will be useful, but
14230557Sjimharris * WITHOUT ANY WARRANTY; without even the implied warranty of
15230557Sjimharris * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16230557Sjimharris * General Public License for more details.
17230557Sjimharris *
18230557Sjimharris * You should have received a copy of the GNU General Public License
19230557Sjimharris * along with this program; if not, write to the Free Software
20230557Sjimharris * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21230557Sjimharris * The full GNU General Public License is included in this distribution
22230557Sjimharris * in the file called LICENSE.GPL.
23230557Sjimharris *
24230557Sjimharris * BSD LICENSE
25230557Sjimharris *
26230557Sjimharris * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27230557Sjimharris * All rights reserved.
28230557Sjimharris *
29230557Sjimharris * Redistribution and use in source and binary forms, with or without
30230557Sjimharris * modification, are permitted provided that the following conditions
31230557Sjimharris * are met:
32230557Sjimharris *
33230557Sjimharris *   * Redistributions of source code must retain the above copyright
34230557Sjimharris *     notice, this list of conditions and the following disclaimer.
35230557Sjimharris *   * Redistributions in binary form must reproduce the above copyright
36230557Sjimharris *     notice, this list of conditions and the following disclaimer in
37230557Sjimharris *     the documentation and/or other materials provided with the
38230557Sjimharris *     distribution.
39230557Sjimharris *
40230557Sjimharris * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41230557Sjimharris * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42230557Sjimharris * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43230557Sjimharris * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44230557Sjimharris * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45230557Sjimharris * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46230557Sjimharris * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47230557Sjimharris * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48230557Sjimharris * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49230557Sjimharris * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50230557Sjimharris * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51230557Sjimharris *
52230557Sjimharris * $FreeBSD$
53230557Sjimharris */
54230557Sjimharris#ifndef _SCIF_USER_CALLBACK_H_
55230557Sjimharris#define _SCIF_USER_CALLBACK_H_
56230557Sjimharris
57230557Sjimharris/**
58230557Sjimharris * @file
59230557Sjimharris *
60230557Sjimharris * @brief This file contains all of the interface methods/macros that must
61230557Sjimharris *        be implemented by an SCI Framework user.
62230557Sjimharris */
63230557Sjimharris
64230557Sjimharris
65230557Sjimharris#ifdef __cplusplus
66230557Sjimharrisextern "C" {
67230557Sjimharris#endif // __cplusplus
68230557Sjimharris
69230557Sjimharris#include <dev/isci/scil/sci_types.h>
70230557Sjimharris#include <dev/isci/scil/sci_status.h>
71230557Sjimharris#include <dev/isci/scil/sci_controller.h>
72230557Sjimharris#include <dev/isci/scil/intel_sas.h>
73230557Sjimharris#include <dev/isci/scil/sci_memory_descriptor_list.h>
74230557Sjimharris
75230557Sjimharris
76230557Sjimharris/**
77230557Sjimharris * @brief This callback method asks the user to create a timer and provide
78230557Sjimharris *        a handle for this timer for use in further timer interactions.
79230557Sjimharris *
80230557Sjimharris * @warning The "timer_callback" method should be executed in a mutually
81230557Sjimharris *          exlusive manner from the controller completion handler
82230557Sjimharris *          handler (refer to scic_controller_get_handler_methods()).
83230557Sjimharris *
84230557Sjimharris * @param[in]  timer_callback This parameter specifies the callback method
85230557Sjimharris *             to be invoked whenever the timer expires.
86230557Sjimharris * @param[in]  controller This parameter specifies the controller with
87230557Sjimharris *             which this timer is to be associated.
88230557Sjimharris * @param[in]  cookie This parameter specifies a piece of information that
89230557Sjimharris *             the user must retain.  This cookie is to be supplied by the
90230557Sjimharris *             user anytime a timeout occurs for the created timer.
91230557Sjimharris *
92230557Sjimharris * @return This method returns a handle to a timer object created by the
93230557Sjimharris *         user.  The handle will be utilized for all further interactions
94230557Sjimharris *         relating to this timer.
95230557Sjimharris */
96230557Sjimharrisvoid * scif_cb_timer_create(
97230557Sjimharris   SCI_CONTROLLER_HANDLE_T   controller,
98230557Sjimharris   SCI_TIMER_CALLBACK_T      timer_callback,
99230557Sjimharris   void                    * cookie
100230557Sjimharris);
101230557Sjimharris
102230557Sjimharris/**
103230557Sjimharris * @brief This callback method asks the user to destory the supplied timer.
104230557Sjimharris *
105230557Sjimharris * @param[in]  controller This parameter specifies the controller with
106230557Sjimharris *             which this timer is to associated.
107230557Sjimharris * @param[in]  timer This parameter specifies the timer to be destroyed.
108230557Sjimharris *
109230557Sjimharris * @return none
110230557Sjimharris */
111230557Sjimharrisvoid scif_cb_timer_destroy(
112230557Sjimharris   SCI_CONTROLLER_HANDLE_T   controller,
113230557Sjimharris   void                    * timer
114230557Sjimharris);
115230557Sjimharris
116230557Sjimharris/**
117230557Sjimharris * @brief This callback method asks the user to start the supplied timer.
118230557Sjimharris *
119230557Sjimharris * @warning All timers in the system started by the SCI Framework are one
120230557Sjimharris *          shot timers.  Therefore, the SCI user should make sure that it
121230557Sjimharris *          removes the timer from it's list when a timer actually fires.
122230557Sjimharris *          Additionally, SCI Framework user's should be able to handle
123230557Sjimharris *          calls from the SCI Framework to stop a timer that may already
124230557Sjimharris *          be stopped.
125230557Sjimharris *
126230557Sjimharris * @param[in]  controller This parameter specifies the controller with
127230557Sjimharris *             which this timer is to associated.
128230557Sjimharris * @param[in]  timer This parameter specifies the timer to be started.
129230557Sjimharris * @param[in]  milliseconds This parameter specifies the number of
130230557Sjimharris *             milliseconds for which to stall.  The operating system driver
131230557Sjimharris *             is allowed to round this value up where necessary.
132230557Sjimharris *
133230557Sjimharris * @return none
134230557Sjimharris */
135230557Sjimharrisvoid scif_cb_timer_start(
136230557Sjimharris   SCI_CONTROLLER_HANDLE_T   controller,
137230557Sjimharris   void                    * timer,
138230557Sjimharris   U32                       milliseconds
139230557Sjimharris);
140230557Sjimharris
141230557Sjimharris/**
142230557Sjimharris * @brief This callback method asks the user to stop the supplied timer.
143230557Sjimharris *
144230557Sjimharris * @param[in]  controller This parameter specifies the controller with
145230557Sjimharris *             which this timer is to associated.
146230557Sjimharris * @param[in]  timer This parameter specifies the timer to be stopped.
147230557Sjimharris *
148230557Sjimharris * @return none
149230557Sjimharris */
150230557Sjimharrisvoid scif_cb_timer_stop(
151230557Sjimharris   SCI_CONTROLLER_HANDLE_T   controller,
152230557Sjimharris   void                    * timer
153230557Sjimharris);
154230557Sjimharris
155230557Sjimharris/**
156230557Sjimharris * @brief This callback method asks the user to associate the supplied
157230557Sjimharris *        lock with an operating environment specific locking construct.
158230557Sjimharris *
159230557Sjimharris * @param[in]  controller This parameter specifies the controller with
160230557Sjimharris *             which this lock is to be associated.
161230557Sjimharris * @param[in]  lock This parameter specifies the lock for which the
162230557Sjimharris *             user should associate an operating environment specific
163230557Sjimharris *             locking object.
164230557Sjimharris *
165230557Sjimharris * @see The SCI_LOCK_LEVEL enumeration for more information.
166230557Sjimharris *
167230557Sjimharris * @return none.
168230557Sjimharris */
169230557Sjimharrisvoid scif_cb_lock_associate(
170230557Sjimharris   SCI_CONTROLLER_HANDLE_T   controller,
171230557Sjimharris   SCI_LOCK_HANDLE_T         lock
172230557Sjimharris);
173230557Sjimharris
174230557Sjimharris/**
175230557Sjimharris * @brief This callback method asks the user to de-associate the supplied
176230557Sjimharris *        lock with an operating environment specific locking construct.
177230557Sjimharris *
178230557Sjimharris * @param[in]  controller This parameter specifies the controller with
179230557Sjimharris *             which this lock is to be de-associated.
180230557Sjimharris * @param[in]  lock This parameter specifies the lock for which the
181230557Sjimharris *             user should de-associate an operating environment specific
182230557Sjimharris *             locking object.
183230557Sjimharris *
184230557Sjimharris * @see The SCI_LOCK_LEVEL enumeration for more information.
185230557Sjimharris *
186230557Sjimharris * @return none.
187230557Sjimharris */
188230557Sjimharrisvoid scif_cb_lock_disassociate(
189230557Sjimharris   SCI_CONTROLLER_HANDLE_T   controller,
190230557Sjimharris   SCI_LOCK_HANDLE_T         lock
191230557Sjimharris);
192230557Sjimharris
193230557Sjimharris
194230557Sjimharris/**
195230557Sjimharris * @brief This callback method asks the user to acquire/get the lock.
196230557Sjimharris *        This method should pend until the lock has been acquired.
197230557Sjimharris *
198230557Sjimharris * @param[in]  controller This parameter specifies the controller with
199230557Sjimharris *             which this lock is associated.
200230557Sjimharris * @param[in]  lock This parameter specifies the lock to be acquired.
201230557Sjimharris *
202230557Sjimharris * @return none
203230557Sjimharris */
204230557Sjimharrisvoid scif_cb_lock_acquire(
205230557Sjimharris   SCI_CONTROLLER_HANDLE_T   controller,
206230557Sjimharris   SCI_LOCK_HANDLE_T         lock
207230557Sjimharris);
208230557Sjimharris
209230557Sjimharris/**
210230557Sjimharris * @brief This callback method asks the user to release a lock.
211230557Sjimharris *
212230557Sjimharris * @param[in]  controller This parameter specifies the controller with
213230557Sjimharris *             which this lock is associated.
214230557Sjimharris * @param[in]  lock This parameter specifies the lock to be released.
215230557Sjimharris *
216230557Sjimharris * @return none
217230557Sjimharris */
218230557Sjimharrisvoid scif_cb_lock_release(
219230557Sjimharris   SCI_CONTROLLER_HANDLE_T   controller,
220230557Sjimharris   SCI_LOCK_HANDLE_T         lock
221230557Sjimharris);
222230557Sjimharris
223230557Sjimharris/**
224230557Sjimharris * @brief This user callback will inform the user that the controller has
225230557Sjimharris *        had a serious unexpected error.  The user should not the error,
226230557Sjimharris *        disable interrupts, and wait for current ongoing processing to
227230557Sjimharris *        complete.  Subsequently, the user should reset the controller.
228230557Sjimharris *
229230557Sjimharris * @param[in]  controller This parameter specifies the controller that had
230230557Sjimharris *             an error.
231230557Sjimharris *
232230557Sjimharris * @return none
233230557Sjimharris */
234230557Sjimharrisvoid scif_cb_controller_error(
235230557Sjimharris   SCI_CONTROLLER_HANDLE_T  controller,
236230557Sjimharris   SCI_CONTROLLER_ERROR error
237230557Sjimharris);
238230557Sjimharris
239230557Sjimharris/**
240230557Sjimharris * @brief This user callback will inform the user that the controller has
241230557Sjimharris *        finished the start process.
242230557Sjimharris *
243230557Sjimharris * @param[in]  controller This parameter specifies the controller that was
244230557Sjimharris *             started.
245230557Sjimharris * @param[in]  completion_status This parameter specifies the results of
246230557Sjimharris *             the start operation.  SCI_SUCCESS indicates successful
247230557Sjimharris *             completion.
248230557Sjimharris *
249230557Sjimharris * @return none
250230557Sjimharris */
251230557Sjimharrisvoid scif_cb_controller_start_complete(
252230557Sjimharris   SCI_CONTROLLER_HANDLE_T  controller,
253230557Sjimharris   SCI_STATUS               completion_status
254230557Sjimharris);
255230557Sjimharris
256230557Sjimharris/**
257230557Sjimharris * @brief This user callback will inform the user that the controller has
258230557Sjimharris *        finished the stop process. Note, after user calls
259230557Sjimharris *        scif_controller_stop(), before user receives this controller stop
260230557Sjimharris *        complete callback, user should not expect any callback from
261230557Sjimharris *        framework, such like scif_cb_domain_change_notification().
262230557Sjimharris *
263230557Sjimharris * @param[in]  controller This parameter specifies the controller that was
264230557Sjimharris *             stopped.
265230557Sjimharris * @param[in]  completion_status This parameter specifies the results of
266230557Sjimharris *             the stop operation.  SCI_SUCCESS indicates successful
267230557Sjimharris *             completion.
268230557Sjimharris *
269230557Sjimharris * @return none
270230557Sjimharris */
271230557Sjimharrisvoid scif_cb_controller_stop_complete(
272230557Sjimharris   SCI_CONTROLLER_HANDLE_T  controller,
273230557Sjimharris   SCI_STATUS               completion_status
274230557Sjimharris);
275230557Sjimharris
276230557Sjimharris/**
277230557Sjimharris * @brief This method simply returns the virtual address associated
278230557Sjimharris *        with the scsi_io and byte_offset supplied parameters.
279230557Sjimharris *
280230557Sjimharris * @note This callback is not utilized in the fast path.  The expectation
281230557Sjimharris *       is that this method is utilized for items such as SCSI to ATA
282230557Sjimharris *       translation for commands like INQUIRY, READ CAPACITY, etc.
283230557Sjimharris *
284230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
285230557Sjimharris *            IO request object.  It is a cookie that allows the user to
286230557Sjimharris *            provide the necessary information for this callback.
287230557Sjimharris * @param[in] byte_offset This parameter specifies the offset into the data
288230557Sjimharris *            buffers pointed to by the SGL.  The byte offset starts at 0
289230557Sjimharris *            and continues until the last byte pointed to be the last SGL
290230557Sjimharris *            element.
291230557Sjimharris *
292230557Sjimharris * @return A virtual address pointer to the location specified by the
293230557Sjimharris *         parameters.
294230557Sjimharris */
295230557SjimharrisU8 * scif_cb_io_request_get_virtual_address_from_sgl(
296230557Sjimharris   void * scif_user_io_request,
297230557Sjimharris   U32    byte_offset
298230557Sjimharris);
299230557Sjimharris
300230557Sjimharris#ifdef ENABLE_OSSL_COPY_BUFFER
301230557Sjimharris/**
302230557Sjimharris * @brief This method is presently utilized in the PIO path,
303230557Sjimharris *        copies from UF buffer to the SGL buffer. This method
304230557Sjimharris *        can be served for other OS related copies.
305230557Sjimharris *
306230557Sjimharris * @param[in] user_io_request. This parameter points to the user's
307230557Sjimharris *            IO request object.  It is a cookie that allows the user to
308230557Sjimharris *            provide the necessary information for this callback.
309230557Sjimharris * @param[in] source addr. Address of UF buffer.
310230557Sjimharris * @param[in] offset. This parameter specifies the offset into the data
311230557Sjimharris *            buffers pointed to by the SGL.  The byte offset starts at 0
312230557Sjimharris *            and continues until the last byte pointed to be the last SGL
313230557Sjimharris *            element.
314230557Sjimharris * @param[in] length.
315230557Sjimharris *
316230557Sjimharris * @return    None
317230557Sjimharris */
318230557Sjimharrisvoid scif_cb_io_request_copy_buffer(
319230557Sjimharris   void * scic_user_io_request,
320230557Sjimharris   U8   *source_addr,
321230557Sjimharris   U32   offset,
322230557Sjimharris   U32   length
323230557Sjimharris);
324230557Sjimharris#endif
325230557Sjimharris
326230557Sjimharris/**
327230557Sjimharris * @brief This user callback will inform the user that an IO request has
328230557Sjimharris *        completed.
329230557Sjimharris *
330230557Sjimharris * @param[in]  controller This parameter specifies the controller on
331230557Sjimharris *             which the IO request is completing.
332230557Sjimharris * @param[in]  remote_device This parameter specifies the remote device on
333230557Sjimharris *             which this request is completing.
334230557Sjimharris * @param[in]  io_request This parameter specifies the IO request that has
335230557Sjimharris *             completed.
336230557Sjimharris * @param[in]  completion_status This parameter specifies the results of
337230557Sjimharris *             the IO request operation.  SCI_IO_SUCCESS indicates
338230557Sjimharris *             successful completion.
339230557Sjimharris *
340230557Sjimharris * @return none
341230557Sjimharris */
342230557Sjimharrisvoid scif_cb_io_request_complete(
343230557Sjimharris   SCI_CONTROLLER_HANDLE_T     controller,
344230557Sjimharris   SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
345230557Sjimharris   SCI_IO_REQUEST_HANDLE_T     io_request,
346230557Sjimharris   SCI_IO_STATUS               completion_status
347230557Sjimharris);
348230557Sjimharris
349230557Sjimharris/**
350230557Sjimharris * @brief This user callback will inform the user that a task management
351230557Sjimharris *        request completed.
352230557Sjimharris *
353230557Sjimharris * @param[in]  controller This parameter specifies the controller on
354230557Sjimharris *             which the task management request is completing.
355230557Sjimharris * @param[in]  remote_device This parameter specifies the remote device on
356230557Sjimharris *             which this task management request is completing.
357230557Sjimharris * @param[in]  task_request This parameter specifies the task management
358230557Sjimharris *             request that has completed.
359230557Sjimharris * @param[in]  completion_status This parameter specifies the results of
360230557Sjimharris *             the IO request operation.  SCI_TASK_SUCCESS indicates
361230557Sjimharris *             successful completion.
362230557Sjimharris *
363230557Sjimharris * @return none
364230557Sjimharris */
365230557Sjimharrisvoid scif_cb_task_request_complete(
366230557Sjimharris   SCI_CONTROLLER_HANDLE_T     controller,
367230557Sjimharris   SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
368230557Sjimharris   SCI_TASK_REQUEST_HANDLE_T   task_request,
369230557Sjimharris   SCI_TASK_STATUS             completion_status
370230557Sjimharris);
371230557Sjimharris
372230557Sjimharris/**
373230557Sjimharris * @brief This callback method asks the user to provide the number of
374230557Sjimharris *        bytes to be transfered as part of this request.
375230557Sjimharris *
376230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
377230557Sjimharris *            IO request object.  It is a cookie that allows the user to
378230557Sjimharris *            provide the necessary information for this callback.
379230557Sjimharris *
380230557Sjimharris * @return This method returns the number of payload data bytes to be
381230557Sjimharris *         transfered for this IO request.
382230557Sjimharris */
383230557SjimharrisU32 scif_cb_io_request_get_transfer_length(
384230557Sjimharris   void * scif_user_io_request
385230557Sjimharris);
386230557Sjimharris
387230557Sjimharris/**
388230557Sjimharris * @brief This callback method asks the user to provide the data direction
389230557Sjimharris *        for this request.
390230557Sjimharris *
391230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
392230557Sjimharris *            IO request object.  It is a cookie that allows the user to
393230557Sjimharris *            provide the necessary information for this callback.
394230557Sjimharris *
395230557Sjimharris * @return This method returns the value of SCI_IO_REQUEST_DATA_OUT,
396230557Sjimharris *         SCI_IO_REQUEST_DATA_IN, or SCI_IO_REQUEST_NO_DATA.
397230557Sjimharris */
398230557SjimharrisSCI_IO_REQUEST_DATA_DIRECTION scif_cb_io_request_get_data_direction(
399230557Sjimharris   void * scif_user_io_request
400230557Sjimharris);
401230557Sjimharris
402230557Sjimharris#ifndef SCI_SGL_OPTIMIZATION_ENABLED
403230557Sjimharris/**
404230557Sjimharris * @brief This callback method asks the user to provide the address
405230557Sjimharris *        to where the next Scatter-Gather Element is located.
406230557Sjimharris *
407230557Sjimharris * Details regarding usage:
408230557Sjimharris *   - Regarding the first SGE: the user should initialize an index,
409230557Sjimharris *     or a pointer, prior to construction of the request that will
410230557Sjimharris *     reference the very first scatter-gather element.  This is
411230557Sjimharris *     important since this method is called for every scatter-gather
412230557Sjimharris *     element, including the first element.
413230557Sjimharris *   - Regarding the last SGE: the user should return NULL from this
414230557Sjimharris *     method when this method is called and the SGL has exhausted
415230557Sjimharris *     all elements.
416230557Sjimharris *
417230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
418230557Sjimharris *            IO request object.  It is a cookie that allows the user to
419230557Sjimharris *            provide the necessary information for this callback.
420230557Sjimharris * @param[in] current_sge_address This parameter specifies the address for
421230557Sjimharris *            the current SGE (i.e. the one that has just processed).
422230557Sjimharris * @param[out] next_sge An address specifying the location for the next scatter
423230557Sjimharris *         gather element to be processed.
424230557Sjimharris *
425230557Sjimharris * @return None.
426230557Sjimharris */
427230557Sjimharrisvoid scif_cb_io_request_get_next_sge(
428230557Sjimharris   void * scif_user_io_request,
429230557Sjimharris   void * current_sge_address,
430230557Sjimharris   void ** next_sge
431230557Sjimharris);
432230557Sjimharris#endif
433230557Sjimharris
434230557Sjimharris/**
435230557Sjimharris * @brief This callback method asks the user to provide the contents of the
436230557Sjimharris *        "address" field in the Scatter-Gather Element.
437230557Sjimharris *
438230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
439230557Sjimharris *            IO request object.  It is a cookie that allows the user to
440230557Sjimharris *            provide the necessary information for this callback.
441230557Sjimharris * @param[in] sge_address This parameter specifies the address for the
442230557Sjimharris *            SGE from which to retrieve the address field.
443230557Sjimharris *
444230557Sjimharris * @return A physical address specifying the contents of the SGE's address
445230557Sjimharris *         field.
446230557Sjimharris */
447230557SjimharrisSCI_PHYSICAL_ADDRESS scif_cb_sge_get_address_field(
448230557Sjimharris   void * scif_user_io_request,
449230557Sjimharris   void * sge_address
450230557Sjimharris);
451230557Sjimharris
452230557Sjimharris/**
453230557Sjimharris * @brief This callback method asks the user to provide the contents of the
454230557Sjimharris *        "length" field in the Scatter-Gather Element.
455230557Sjimharris *
456230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
457230557Sjimharris *            IO request object.  It is a cookie that allows the user to
458230557Sjimharris *            provide the necessary information for this callback.
459230557Sjimharris * @param[in] sge_address This parameter specifies the address for the
460230557Sjimharris *            SGE from which to retrieve the address field.
461230557Sjimharris *
462230557Sjimharris * @return This method returns the length field specified inside the SGE
463230557Sjimharris *         referenced by the sge_address parameter.
464230557Sjimharris */
465230557SjimharrisU32 scif_cb_sge_get_length_field(
466230557Sjimharris   void * scif_user_io_request,
467230557Sjimharris   void * sge_address
468230557Sjimharris);
469230557Sjimharris
470230557Sjimharris/**
471230557Sjimharris * @brief This callback method asks the user to provide the address for
472230557Sjimharris *        the command descriptor block (CDB) associated with this IO request.
473230557Sjimharris *
474230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
475230557Sjimharris *            IO request object.  It is a cookie that allows the user to
476230557Sjimharris *            provide the necessary information for this callback.
477230557Sjimharris *
478230557Sjimharris * @return This method returns the virtual address of the CDB.
479230557Sjimharris */
480230557Sjimharrisvoid * scif_cb_io_request_get_cdb_address(
481230557Sjimharris   void * scif_user_io_request
482230557Sjimharris);
483230557Sjimharris
484230557Sjimharris/**
485230557Sjimharris * @brief This callback method asks the user to provide the length of
486230557Sjimharris *        the command descriptor block (CDB) associated with this IO request.
487230557Sjimharris *
488230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
489230557Sjimharris *            IO request object.  It is a cookie that allows the user to
490230557Sjimharris *            provide the necessary information for this callback.
491230557Sjimharris *
492230557Sjimharris * @return This method returns the length of the CDB.
493230557Sjimharris */
494230557SjimharrisU32 scif_cb_io_request_get_cdb_length(
495230557Sjimharris   void * scif_user_io_request
496230557Sjimharris);
497230557Sjimharris
498230557Sjimharris/**
499230557Sjimharris * @brief This callback method asks the user to provide the Logical Unit (LUN)
500230557Sjimharris *        associated with this IO request.
501230557Sjimharris *
502230557Sjimharris * @note The contents of the value returned from this callback are defined
503230557Sjimharris *       by the protocol standard (e.g. T10 SAS specification).  Please
504230557Sjimharris *       refer to the transport command information unit description
505230557Sjimharris *       in the associated standard.
506230557Sjimharris *
507230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
508230557Sjimharris *            IO request object.  It is a cookie that allows the user to
509230557Sjimharris *            provide the necessary information for this callback.
510230557Sjimharris *
511230557Sjimharris * @return This method returns the LUN associated with this request.
512230557Sjimharris */
513230557SjimharrisU32 scif_cb_io_request_get_lun(
514230557Sjimharris   void * scif_user_io_request
515230557Sjimharris);
516230557Sjimharris
517230557Sjimharris/**
518230557Sjimharris * @brief This callback method asks the user to provide the task attribute
519230557Sjimharris *        associated with this IO request.
520230557Sjimharris *
521230557Sjimharris * @note The contents of the value returned from this callback are defined
522230557Sjimharris *       by the protocol standard (e.g. T10 SAS specification).  Please
523230557Sjimharris *       refer to the transport command information unit description
524230557Sjimharris *       in the associated standard.
525230557Sjimharris *
526230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
527230557Sjimharris *            IO request object.  It is a cookie that allows the user to
528230557Sjimharris *            provide the necessary information for this callback.
529230557Sjimharris *
530230557Sjimharris * @return This method returns the task attribute associated with this
531230557Sjimharris *         IO request.
532230557Sjimharris */
533230557SjimharrisU32 scif_cb_io_request_get_task_attribute(
534230557Sjimharris   void * scif_user_io_request
535230557Sjimharris);
536230557Sjimharris
537230557Sjimharris/**
538230557Sjimharris * @brief This callback method asks the user to provide the command priority
539230557Sjimharris *        associated with this IO request.
540230557Sjimharris *
541230557Sjimharris * @note The contents of the value returned from this callback are defined
542230557Sjimharris *       by the protocol standard (e.g. T10 SAS specification).  Please
543230557Sjimharris *       refer to the transport command information unit description
544230557Sjimharris *       in the associated standard.
545230557Sjimharris *
546230557Sjimharris * @param[in] scif_user_io_request This parameter points to the user's
547230557Sjimharris *            IO request object.  It is a cookie that allows the user to
548230557Sjimharris *            provide the necessary information for this callback.
549230557Sjimharris *
550230557Sjimharris * @return This method returns the command priority associated with this
551230557Sjimharris *         IO request.
552230557Sjimharris */
553230557SjimharrisU32 scif_cb_io_request_get_command_priority(
554230557Sjimharris   void * scif_user_io_request
555230557Sjimharris);
556230557Sjimharris
557230557Sjimharris/**
558230557Sjimharris * @brief This method returns the Logical Unit to be utilized for this
559230557Sjimharris *        task management request.
560230557Sjimharris *
561230557Sjimharris * @note The contents of the value returned from this callback are defined
562230557Sjimharris *       by the protocol standard (e.g. T10 SAS specification).  Please
563230557Sjimharris *       refer to the transport task information unit description
564230557Sjimharris *       in the associated standard.
565230557Sjimharris *
566230557Sjimharris * @param[in] scif_user_task_request This parameter points to the user's
567230557Sjimharris *            task request object.  It is a cookie that allows the user to
568230557Sjimharris *            provide the necessary information for this callback.
569230557Sjimharris *
570230557Sjimharris * @return This method returns the LUN associated with this request.
571230557Sjimharris * @todo This should be U64?
572230557Sjimharris */
573230557SjimharrisU32 scif_cb_task_request_get_lun(
574230557Sjimharris   void * scif_user_task_request
575230557Sjimharris);
576230557Sjimharris
577230557Sjimharris/**
578230557Sjimharris * @brief This method returns the task management function to be utilized
579230557Sjimharris *        for this task request.
580230557Sjimharris *
581230557Sjimharris * @note The contents of the value returned from this callback are defined
582230557Sjimharris *       by the protocol standard (e.g. T10 SAS specification).  Please
583230557Sjimharris *       refer to the transport task information unit description
584230557Sjimharris *       in the associated standard.
585230557Sjimharris *
586230557Sjimharris * @param[in] scif_user_task_request This parameter points to the user's
587230557Sjimharris *            task request object.  It is a cookie that allows the user to
588230557Sjimharris *            provide the necessary information for this callback.
589230557Sjimharris *
590230557Sjimharris * @return This method returns an unsigned byte representing the task
591230557Sjimharris *         management function to be performed.
592230557Sjimharris */
593230557SjimharrisU8 scif_cb_task_request_get_function(
594230557Sjimharris   void * scif_user_task_request
595230557Sjimharris);
596230557Sjimharris
597230557Sjimharris/**
598230557Sjimharris * @brief This method returns the task management IO tag to be managed.
599230557Sjimharris *        Depending upon the task management function the value returned
600230557Sjimharris *        from this method may be ignored.
601230557Sjimharris *
602230557Sjimharris * @param[in] scif_user_task_request This parameter points to the user's
603230557Sjimharris *            task request object.  It is a cookie that allows the user to
604230557Sjimharris *            provide the necessary information for this callback.
605230557Sjimharris *
606230557Sjimharris * @return This method returns an unsigned 16-bit word depicting the IO
607230557Sjimharris *         tag to be managed.
608230557Sjimharris */
609230557SjimharrisU16 scif_cb_task_request_get_io_tag_to_manage(
610230557Sjimharris   void * scif_user_task_request
611230557Sjimharris);
612230557Sjimharris
613230557Sjimharris/**
614230557Sjimharris * @brief This callback method asks the user to provide the virtual
615230557Sjimharris *        address of the response data buffer for the supplied IO request.
616230557Sjimharris *
617230557Sjimharris * @param[in] scif_user_task_request This parameter points to the user's
618230557Sjimharris *            task request object.  It is a cookie that allows the user to
619230557Sjimharris *            provide the necessary information for this callback.
620230557Sjimharris *
621230557Sjimharris * @return This method returns the virtual address for the response data buffer
622230557Sjimharris *         associated with this IO request.
623230557Sjimharris */
624230557Sjimharrisvoid * scif_cb_task_request_get_response_data_address(
625230557Sjimharris   void * scif_user_task_request
626230557Sjimharris);
627230557Sjimharris
628230557Sjimharris/**
629230557Sjimharris * @brief This callback method asks the user to provide the length of the
630230557Sjimharris *        response data buffer for the supplied IO request.
631230557Sjimharris *
632230557Sjimharris * @param[in] scif_user_task_request This parameter points to the user's
633230557Sjimharris *            task request object.  It is a cookie that allows the user to
634230557Sjimharris *            provide the necessary information for this callback.
635230557Sjimharris *
636230557Sjimharris * @return This method returns the length of the response buffer data
637230557Sjimharris *         associated with this IO request.
638230557Sjimharris */
639230557SjimharrisU32 scif_cb_task_request_get_response_data_length(
640230557Sjimharris   void * scif_user_task_request
641230557Sjimharris);
642230557Sjimharris
643230557Sjimharris/**
644230557Sjimharris * @brief In this method the user is expected to log the supplied
645230557Sjimharris *        error information.  The user must be capable of handling variable
646230557Sjimharris *        length argument lists and should consider prepending the fact
647230557Sjimharris *        that this is an error from the framework.
648230557Sjimharris *
649230557Sjimharris * @param[in]  logger_object This parameter specifies the logger object
650230557Sjimharris *             associated with this message.
651230557Sjimharris * @param[in]  log_object_mask This parameter specifies the log objects
652230557Sjimharris *             for which this message is being generated.
653230557Sjimharris * @param[in]  log_message This parameter specifies the message to be logged.
654230557Sjimharris *
655230557Sjimharris * @return none
656230557Sjimharris */
657230557Sjimharrisvoid scif_cb_logger_log_error(
658230557Sjimharris   SCI_LOGGER_HANDLE_T   logger_object,
659230557Sjimharris   U32                   log_object_mask,
660230557Sjimharris   char                * log_message,
661230557Sjimharris   ...
662230557Sjimharris);
663230557Sjimharris
664230557Sjimharris/**
665230557Sjimharris * @brief In this method the user is expected to log the supplied warning
666230557Sjimharris *        information.  The user must be capable of handling variable
667230557Sjimharris *        length argument lists and should consider prepending the fact
668230557Sjimharris *        that this is a warning from the framework.
669230557Sjimharris *
670230557Sjimharris * @param[in]  logger_object This parameter specifies the logger object
671230557Sjimharris *             associated with this message.
672230557Sjimharris * @param[in]  log_object_mask This parameter specifies the log objects
673230557Sjimharris *             for which this message is being generated.
674230557Sjimharris * @param[in]  log_message This parameter specifies the message to be logged.
675230557Sjimharris *
676230557Sjimharris * @return none
677230557Sjimharris */
678230557Sjimharrisvoid scif_cb_logger_log_warning(
679230557Sjimharris   SCI_LOGGER_HANDLE_T   logger_object,
680230557Sjimharris   U32                   log_object_mask,
681230557Sjimharris   char                * log_message,
682230557Sjimharris   ...
683230557Sjimharris);
684230557Sjimharris
685230557Sjimharris/**
686230557Sjimharris * @brief In this method the user is expected to log the supplied debug
687230557Sjimharris *        information.  The user must be capable of handling variable
688230557Sjimharris *        length argument lists and should consider prepending the fact
689230557Sjimharris *        that this is a debug message from the framework.
690230557Sjimharris *
691230557Sjimharris * @param[in]  logger_object This parameter specifies the logger object
692230557Sjimharris *             associated with this message.
693230557Sjimharris * @param[in]  log_object_mask This parameter specifies the log objects
694230557Sjimharris *             for which this message is being generated.
695230557Sjimharris * @param[in]  log_message This parameter specifies the message to be logged.
696230557Sjimharris *
697230557Sjimharris * @return none
698230557Sjimharris */
699230557Sjimharrisvoid scif_cb_logger_log_info(
700230557Sjimharris   SCI_LOGGER_HANDLE_T   logger_object,
701230557Sjimharris   U32                   log_object_mask,
702230557Sjimharris   char                * log_message,
703230557Sjimharris   ...
704230557Sjimharris);
705230557Sjimharris
706230557Sjimharris
707230557Sjimharris/**
708230557Sjimharris * @brief In this method the user is expected to log the supplied function
709230557Sjimharris *        trace information.  The user must be capable of handling variable
710230557Sjimharris *        length argument lists and should consider prepending the fact
711230557Sjimharris *        that this is a function trace (i.e. entry/exit) message from the
712230557Sjimharris *        framework.
713230557Sjimharris *
714230557Sjimharris * @param[in]  logger_object This parameter specifies the logger object
715230557Sjimharris *             associated with this message.
716230557Sjimharris * @param[in]  log_object_mask This parameter specifies the log objects
717230557Sjimharris *             for which this message is being generated.
718230557Sjimharris * @param[in]  log_message This parameter specifies the message to be logged.
719230557Sjimharris *
720230557Sjimharris * @return none
721230557Sjimharris */
722230557Sjimharrisvoid scif_cb_logger_log_trace(
723230557Sjimharris   SCI_LOGGER_HANDLE_T   logger_object,
724230557Sjimharris   U32                   log_object_mask,
725230557Sjimharris   char                * log_message,
726230557Sjimharris   ...
727230557Sjimharris);
728230557Sjimharris
729230557Sjimharris
730230557Sjimharris/**
731230557Sjimharris * @brief In this method the user is expected to log the supplied state
732230557Sjimharris *        transition information.  The user must be capable of handling
733230557Sjimharris *        variable length argument lists and should consider prepending the
734230557Sjimharris *        fact that this is an error from the framework.
735230557Sjimharris *
736230557Sjimharris * @param[in]  logger_object This parameter specifies the logger object
737230557Sjimharris *             associated with this message.
738230557Sjimharris * @param[in]  log_object_mask This parameter specifies the log objects
739230557Sjimharris *             for which this message is being generated.
740230557Sjimharris * @param[in]  log_message This parameter specifies the message to be logged.
741230557Sjimharris *
742230557Sjimharris * @return none
743230557Sjimharris */
744230557Sjimharrisvoid scif_cb_logger_log_states(
745230557Sjimharris   SCI_LOGGER_HANDLE_T   logger_object,
746230557Sjimharris   U32                   log_object_mask,
747230557Sjimharris   char                * log_message,
748230557Sjimharris   ...
749230557Sjimharris);
750230557Sjimharris
751230557Sjimharris
752230557Sjimharris/**
753230557Sjimharris * @brief This callback method informs the framework user that something
754230557Sjimharris *        in the supplied domain has changed (e.g. a device was added or
755230557Sjimharris *        removed).
756230557Sjimharris *
757230557Sjimharris * This callback is called by the framework outside of discovery or
758230557Sjimharris * target reset processes.  Specifically, domain changes occurring
759230557Sjimharris * during these processes are handled by the framework.  For example,
760230557Sjimharris * in the case of Serial Attached SCSI, reception of a BROADCAST (CHANGE)
761230557Sjimharris * during discovery will cause discovery to restart.  Thus, discovery
762230557Sjimharris * does not complete until all BCNs are processed. Note, during controller
763230557Sjimharris * stopping/reset process, the framework user should not expect this call
764230557Sjimharris * back.
765230557Sjimharris *
766230557Sjimharris * @param[in]  controller This parameter specifies the controller object
767230557Sjimharris *             with which this callback is associated.
768230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
769230557Sjimharris *             which this callback is associated.
770230557Sjimharris *
771230557Sjimharris * @return none
772230557Sjimharris */
773230557Sjimharrisvoid scif_cb_domain_change_notification(
774230557Sjimharris   SCI_CONTROLLER_HANDLE_T  controller,
775230557Sjimharris   SCI_DOMAIN_HANDLE_T      domain
776230557Sjimharris);
777230557Sjimharris
778230557Sjimharris
779230557Sjimharris/**
780230557Sjimharris * @brief This callback method informs the framework user that a previously
781230557Sjimharris *        requested discovery operation on the domain has completed.
782230557Sjimharris *
783230557Sjimharris * @param[in]  controller This parameter specifies the controller object
784230557Sjimharris *             with which this callback is associated.
785230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
786230557Sjimharris *             which this callback is associated.
787230557Sjimharris * @param[in]  completion_status This parameter indicates the results of the
788230557Sjimharris *             discovery operation.
789230557Sjimharris *
790230557Sjimharris * @return none
791230557Sjimharris */
792230557Sjimharrisvoid scif_cb_domain_discovery_complete(
793230557Sjimharris   SCI_CONTROLLER_HANDLE_T  controller,
794230557Sjimharris   SCI_DOMAIN_HANDLE_T      domain,
795230557Sjimharris   SCI_STATUS               completion_status
796230557Sjimharris);
797230557Sjimharris
798230557Sjimharris/**
799230557Sjimharris * @brief This callback method informs the framework user that a previously
800230557Sjimharris *        requested reset operation on the domain has completed.
801230557Sjimharris *
802230557Sjimharris * @param[in]  controller This parameter specifies the controller object
803230557Sjimharris *             with which this callback is associated.
804230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
805230557Sjimharris *             which this callback is associated.
806230557Sjimharris * @param[in]  completion_status This parameter indicates the results of the
807230557Sjimharris *             reset operation.
808230557Sjimharris *
809230557Sjimharris * @return none
810230557Sjimharris */
811230557Sjimharrisvoid scif_cb_domain_reset_complete(
812230557Sjimharris   SCI_CONTROLLER_HANDLE_T  controller,
813230557Sjimharris   SCI_DOMAIN_HANDLE_T      domain,
814230557Sjimharris   SCI_STATUS               completion_status
815230557Sjimharris);
816230557Sjimharris
817230557Sjimharris/**
818230557Sjimharris * @brief This callback method informs the framework user that the domain
819230557Sjimharris *        is ready and capable of processing IO requests for devices found
820230557Sjimharris *        inside it.
821230557Sjimharris *
822230557Sjimharris * @param[in]  controller This parameter specifies the controller object
823230557Sjimharris *             with which this callback is associated.
824230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
825230557Sjimharris *             which this callback is associated.
826230557Sjimharris *
827230557Sjimharris * @return none
828230557Sjimharris */
829230557Sjimharrisvoid scif_cb_domain_ready(
830230557Sjimharris   SCI_CONTROLLER_HANDLE_T  controller,
831230557Sjimharris   SCI_DOMAIN_HANDLE_T      domain
832230557Sjimharris);
833230557Sjimharris
834230557Sjimharris/**
835230557Sjimharris * @brief This callback method informs the framework user that the domain
836230557Sjimharris *        is no longer ready. Thus, it is incapable of processing IO
837230557Sjimharris *        requests for devices found inside it.
838230557Sjimharris *
839230557Sjimharris * @param[in]  controller This parameter specifies the controller object
840230557Sjimharris *             with which this callback is associated.
841230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
842230557Sjimharris *             which this callback is associated.
843230557Sjimharris *
844230557Sjimharris * @return none
845230557Sjimharris */
846230557Sjimharrisvoid scif_cb_domain_not_ready(
847230557Sjimharris   SCI_CONTROLLER_HANDLE_T  controller,
848230557Sjimharris   SCI_DOMAIN_HANDLE_T      domain
849230557Sjimharris);
850230557Sjimharris
851230557Sjimharris/**
852230557Sjimharris * @brief This callback method informs the framework user that a new
853230557Sjimharris *        direct attached device was found in the domain.
854230557Sjimharris *
855230557Sjimharris * @param[in]  controller This parameter specifies the controller object
856230557Sjimharris *             with which this callback is associated.
857230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
858230557Sjimharris *             which this callback is associated.
859230557Sjimharris * @param[in]  sas_address This parameter specifies the SAS address of
860230557Sjimharris *             the new device.
861230557Sjimharris * @param[in]  protocols This parameter specifies the protocols
862230557Sjimharris *             supported by the newly discovered device.
863230557Sjimharris *
864230557Sjimharris * @return none
865230557Sjimharris */
866230557Sjimharrisvoid scif_cb_domain_da_device_added(
867230557Sjimharris   SCI_CONTROLLER_HANDLE_T                      controller,
868230557Sjimharris   SCI_DOMAIN_HANDLE_T                          domain,
869230557Sjimharris   SCI_SAS_ADDRESS_T                          * sas_address,
870230557Sjimharris   SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS_T * protocols
871230557Sjimharris);
872230557Sjimharris
873230557Sjimharris/**
874230557Sjimharris * @brief This callback method informs the framework user that a new
875230557Sjimharris *        expander attached device was found in the domain.
876230557Sjimharris *
877230557Sjimharris * @param[in]  controller This parameter specifies the controller object
878230557Sjimharris *             with which this callback is associated.
879230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
880230557Sjimharris *             which this callback is associated.
881230557Sjimharris * @param[in]  containing_device This parameter specifies the remote
882230557Sjimharris *             device that contains the device that was added.
883230557Sjimharris * @param[in]  smp_response This parameter specifies the SMP response
884230557Sjimharris *             data associated with the newly discovered device.
885230557Sjimharris *
886230557Sjimharris * @return none
887230557Sjimharris */
888230557Sjimharrisvoid scif_cb_domain_ea_device_added(
889230557Sjimharris   SCI_CONTROLLER_HANDLE_T      controller,
890230557Sjimharris   SCI_DOMAIN_HANDLE_T          domain,
891230557Sjimharris   SCI_REMOTE_DEVICE_HANDLE_T   containing_device,
892230557Sjimharris   SMP_RESPONSE_DISCOVER_T    * smp_response
893230557Sjimharris);
894230557Sjimharris
895230557Sjimharris/**
896230557Sjimharris * @brief This callback method informs the framework user that a device
897230557Sjimharris *        has been removed from the domain.
898230557Sjimharris *
899230557Sjimharris * @param[in]  controller This parameter specifies the controller object
900230557Sjimharris *             with which this callback is associated.
901230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
902230557Sjimharris *             which this callback is associated.
903230557Sjimharris * @param[in]  remote_device This parameter specifies the device object with
904230557Sjimharris *             which this callback is associated.
905230557Sjimharris *
906230557Sjimharris * @return none
907230557Sjimharris */
908230557Sjimharrisvoid scif_cb_domain_device_removed(
909230557Sjimharris   SCI_CONTROLLER_HANDLE_T     controller,
910230557Sjimharris   SCI_DOMAIN_HANDLE_T         domain,
911230557Sjimharris   SCI_REMOTE_DEVICE_HANDLE_T  remote_device
912230557Sjimharris);
913230557Sjimharris
914230557Sjimharris/**
915230557Sjimharris * @brief This callback method informs the framework user that the remote
916230557Sjimharris *        device is ready and capable of processing IO requests.
917230557Sjimharris *
918230557Sjimharris * @param[in]  controller This parameter specifies the controller object
919230557Sjimharris *             with which this callback is associated.
920230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
921230557Sjimharris *             which this callback is associated.
922230557Sjimharris * @param[in]  remote_device This parameter specifies the device object with
923230557Sjimharris *             which this callback is associated.
924230557Sjimharris *
925230557Sjimharris * @return none
926230557Sjimharris */
927230557Sjimharrisvoid scif_cb_remote_device_ready(
928230557Sjimharris   SCI_CONTROLLER_HANDLE_T     controller,
929230557Sjimharris   SCI_DOMAIN_HANDLE_T         domain,
930230557Sjimharris   SCI_REMOTE_DEVICE_HANDLE_T  remote_device
931230557Sjimharris);
932230557Sjimharris
933230557Sjimharris/**
934230557Sjimharris * @brief This callback method informs the framework user that the remote
935230557Sjimharris *        device is not ready.  Thus, it is incapable of processing IO
936230557Sjimharris *        requests.
937230557Sjimharris *
938230557Sjimharris * @param[in]  controller This parameter specifies the controller object
939230557Sjimharris *             with which this callback is associated.
940230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
941230557Sjimharris *             which this callback is associated.
942230557Sjimharris * @param[in]  remote_device This parameter specifies the device object with
943230557Sjimharris *             which this callback is associated.
944230557Sjimharris *
945230557Sjimharris * @return none
946230557Sjimharris */
947230557Sjimharrisvoid scif_cb_remote_device_not_ready(
948230557Sjimharris   SCI_CONTROLLER_HANDLE_T     controller,
949230557Sjimharris   SCI_DOMAIN_HANDLE_T         domain,
950230557Sjimharris   SCI_REMOTE_DEVICE_HANDLE_T  remote_device
951230557Sjimharris);
952230557Sjimharris
953230557Sjimharris/**
954230557Sjimharris * @brief This callback method informs the framework user that the remote
955230557Sjimharris *        device failed.  This typically occurs shortly after the device
956230557Sjimharris *        has been discovered, during the configuration phase for the device.
957230557Sjimharris *
958230557Sjimharris * @param[in]  controller This parameter specifies the controller object
959230557Sjimharris *             with which this callback is associated.
960230557Sjimharris * @param[in]  domain This parameter specifies the domain object with
961230557Sjimharris *             which this callback is associated.
962230557Sjimharris * @param[in]  remote_device This parameter specifies the device object with
963230557Sjimharris *             which this callback is associated.
964230557Sjimharris * @param[in]  status This parameter specifies the specific failure condition
965230557Sjimharris *             associated with this device failure.
966230557Sjimharris *
967230557Sjimharris * @return none
968230557Sjimharris */
969230557Sjimharrisvoid scif_cb_remote_device_failed(
970230557Sjimharris   SCI_CONTROLLER_HANDLE_T     controller,
971230557Sjimharris   SCI_DOMAIN_HANDLE_T         domain,
972230557Sjimharris   SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
973230557Sjimharris   SCI_STATUS                  status
974230557Sjimharris);
975230557Sjimharris
976230557Sjimharris
977230557Sjimharris
978230557Sjimharris/**
979230557Sjimharris * @brief This callback method creates an OS specific deferred task
980230557Sjimharris *        for internal usage. The handler to deferred task is stored by OS
981230557Sjimharris *        driver.
982230557Sjimharris *
983230557Sjimharris * @param[in] controller This parameter specifies the controller object
984230557Sjimharris *            with which this callback is associated.
985230557Sjimharris *
986230557Sjimharris * @return none
987230557Sjimharris */
988230557Sjimharrisvoid scif_cb_start_internal_io_task_create(
989230557Sjimharris   SCI_CONTROLLER_HANDLE_T controller
990230557Sjimharris);
991230557Sjimharris
992230557Sjimharris
993230557Sjimharris/**
994230557Sjimharris * @brief This callback method schedules a OS specific deferred task.
995230557Sjimharris *
996230557Sjimharris * @param[in] controller This parameter specifies the controller
997230557Sjimharris *            object with which this callback is associated.
998230557Sjimharris * @param[in] start_internal_io_task_routine This parameter specifies the
999230557Sjimharris *            sci start_internal_io routine.
1000230557Sjimharris * @param[in] context This parameter specifies a handle to a parameter
1001230557Sjimharris *            that will be passed into the "start_internal_io_task_routine"
1002230557Sjimharris *            when it is invoked.
1003230557Sjimharris *
1004230557Sjimharris * @return none
1005230557Sjimharris */
1006230557Sjimharrisvoid scif_cb_start_internal_io_task_schedule(
1007230557Sjimharris   SCI_CONTROLLER_HANDLE_T controller,
1008230557Sjimharris   FUNCPTR                 start_internal_io_task_routine,
1009230557Sjimharris   void                  * context
1010230557Sjimharris);
1011230557Sjimharris
1012230557Sjimharris/**
1013230557Sjimharris * @brief This method will be invoked to allocate memory dynamically.
1014230557Sjimharris *
1015230557Sjimharris * @param[in]  controller This parameter represents the controller
1016230557Sjimharris *             object for which to allocate memory.
1017230557Sjimharris * @param[out] mde This parameter represents the memory descriptor to
1018230557Sjimharris *             be filled in by the user that will reference the newly
1019230557Sjimharris *             allocated memory.
1020230557Sjimharris *
1021230557Sjimharris * @return none
1022230557Sjimharris */
1023230557Sjimharrisvoid scif_cb_controller_allocate_memory(
1024230557Sjimharris   SCI_CONTROLLER_HANDLE_T            controller,
1025230557Sjimharris   SCI_PHYSICAL_MEMORY_DESCRIPTOR_T * mde
1026230557Sjimharris);
1027230557Sjimharris
1028230557Sjimharris/**
1029230557Sjimharris * @brief This method will be invoked to allocate memory dynamically.
1030230557Sjimharris *
1031230557Sjimharris * @param[in]  controller This parameter represents the controller
1032230557Sjimharris *             object for which to allocate memory.
1033230557Sjimharris * @param[out] mde This parameter represents the memory descriptor to
1034230557Sjimharris *             be filled in by the user that will reference the newly
1035230557Sjimharris *             allocated memory.
1036230557Sjimharris *
1037230557Sjimharris * @return none
1038230557Sjimharris */
1039230557Sjimharrisvoid scif_cb_controller_free_memory(
1040230557Sjimharris   SCI_CONTROLLER_HANDLE_T            controller,
1041230557Sjimharris   SCI_PHYSICAL_MEMORY_DESCRIPTOR_T * mde
1042230557Sjimharris);
1043230557Sjimharris
1044230557Sjimharris#ifdef __cplusplus
1045230557Sjimharris}
1046230557Sjimharris#endif // __cplusplus
1047230557Sjimharris
1048230557Sjimharris#endif // _SCIF_USER_CALLBACK_H_
1049230557Sjimharris
1050