2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 #ifndef _SCIC_USER_CALLBACK_H_
55 #define _SCIC_USER_CALLBACK_H_
60 * @brief This file contains all of the interface methods/macros that must
61 * be implemented by an SCI Core user.
68 #include <dev/isci/scil/sci_types.h>
69 #include <dev/isci/scil/sci_status.h>
70 #include <dev/isci/scil/sci_controller.h>
73 * @brief This callback method asks the user to create a timer and provide
74 * a handle for this timer for use in further timer interactions.
76 * @warning The "timer_callback" method should be executed in a mutually
77 * exlusive manner from the controller completion handler
78 * handler (refer to scic_controller_get_handler_methods()).
80 * @param[in] controller This parameter specifies the controller with
81 * which this timer is to be associated.
82 * @param[in] timer_callback This parameter specifies the callback method
83 * to be invoked whenever the timer expires.
84 * @param[in] cookie This parameter specifies a piece of information that
85 * the user must retain. This cookie is to be supplied by the
86 * user anytime a timeout occurs for the created timer.
88 * @return This method returns a handle to a timer object created by the
89 * user. The handle will be utilized for all further interactions
90 * relating to this timer.
92 void * scic_cb_timer_create(
93 SCI_CONTROLLER_HANDLE_T controller,
94 SCI_TIMER_CALLBACK_T timer_callback,
99 * @brief This callback method asks the user to destroy the supplied timer.
101 * @param[in] controller This parameter specifies the controller with
102 * which this timer is to associated.
103 * @param[in] timer This parameter specifies the timer to be destroyed.
107 void scic_cb_timer_destroy(
108 SCI_CONTROLLER_HANDLE_T controller,
113 * @brief This callback method asks the user to start the supplied timer.
115 * @warning All timers in the system started by the SCI Core are one shot
116 * timers. Therefore, the SCI user should make sure that it
117 * removes the timer from it's list when a timer actually fires.
118 * Additionally, SCI Core user's should be able to handle
119 * calls from the SCI Core to stop a timer that may already
122 * @param[in] controller This parameter specifies the controller with
123 * which this timer is to associated.
124 * @param[in] timer This parameter specifies the timer to be started.
125 * @param[in] milliseconds This parameter specifies the number of
126 * milliseconds for which to stall. The operating system driver
127 * is allowed to round this value up where necessary.
131 void scic_cb_timer_start(
132 SCI_CONTROLLER_HANDLE_T controller,
138 * @brief This callback method asks the user to stop the supplied timer.
140 * @param[in] controller This parameter specifies the controller with
141 * which this timer is to associated.
142 * @param[in] timer This parameter specifies the timer to be stopped.
146 void scic_cb_timer_stop(
147 SCI_CONTROLLER_HANDLE_T controller,
152 * @brief This method is called when the core requires the OS driver
153 * to stall execution. This method is utilized during initialization
154 * or non-performance paths only.
156 * @param[in] microseconds This parameter specifies the number of
157 * microseconds for which to stall. The operating system driver
158 * is allowed to round this value up where necessary.
162 void scic_cb_stall_execution(
167 * @brief This user callback will inform the user that the controller has
168 * finished the start process.
170 * @param[in] controller This parameter specifies the controller that was
172 * @param[in] completion_status This parameter specifies the results of
173 * the start operation. SCI_SUCCESS indicates successful
178 void scic_cb_controller_start_complete(
179 SCI_CONTROLLER_HANDLE_T controller,
180 SCI_STATUS completion_status
184 * @brief This user callback will inform the user that the controller has
185 * finished the stop process.
187 * @param[in] controller This parameter specifies the controller that was
189 * @param[in] completion_status This parameter specifies the results of
190 * the stop operation. SCI_SUCCESS indicates successful
195 void scic_cb_controller_stop_complete(
196 SCI_CONTROLLER_HANDLE_T controller,
197 SCI_STATUS completion_status
201 * @brief This user callback will inform the user that an IO request has
204 * @param[in] controller This parameter specifies the controller on
205 * which the IO is completing.
206 * @param[in] remote_device This parameter specifies the remote device on
207 * which this IO request is completing.
208 * @param[in] io_request This parameter specifies the IO request that has
210 * @param[in] completion_status This parameter specifies the results of
211 * the IO request operation. SCI_SUCCESS indicates successful
216 void scic_cb_io_request_complete(
217 SCI_CONTROLLER_HANDLE_T controller,
218 SCI_REMOTE_DEVICE_HANDLE_T remote_device,
219 SCI_IO_REQUEST_HANDLE_T io_request,
220 SCI_IO_STATUS completion_status
224 * @brief This method simply returns the virtual address associated
225 * with the scsi_io and byte_offset supplied parameters.
227 * @note This callback is not utilized in the fast path. The expectation
228 * is that this method is utilized for items such as SCSI to ATA
229 * translation for commands like INQUIRY, READ CAPACITY, etc.
231 * @param[in] scic_user_io_request This parameter points to the user's
232 * IO request object. It is a cookie that allows the user to
233 * provide the necessary information for this callback.
234 * @param[in] byte_offset This parameter specifies the offset into the data
235 * buffers pointed to by the SGL. The byte offset starts at 0
236 * and continues until the last byte pointed to be the last SGL
239 * @return A virtual address pointer to the location specified by the
242 U8 *scic_cb_io_request_get_virtual_address_from_sgl(
243 void * scic_user_io_request,
248 * @brief This user callback will inform the user that a task management
251 * @param[in] controller This parameter specifies the controller on
252 * which the task management request is completing.
253 * @param[in] remote_device This parameter specifies the remote device on
254 * which this task management request is completing.
255 * @param[in] task_request This parameter specifies the task management
256 * request that has completed.
257 * @param[in] completion_status This parameter specifies the results of
258 * the IO request operation. SCI_SUCCESS indicates successful
263 void scic_cb_task_request_complete(
264 SCI_CONTROLLER_HANDLE_T controller,
265 SCI_REMOTE_DEVICE_HANDLE_T remote_device,
266 SCI_TASK_REQUEST_HANDLE_T task_request,
267 SCI_TASK_STATUS completion_status
270 #ifndef SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED
272 * @brief This callback method asks the user to provide the physical
273 * address for the supplied virtual address when building an
276 * @param[in] controller This parameter is the core controller object
278 * @param[in] io_request This parameter is the io request object handle
279 * for which the physical address is being requested.
280 * @param[in] virtual_address This parameter is the virtual address which
281 * is to be returned as a physical address.
282 * @param[out] physical_address The physical address for the supplied virtual
287 void scic_cb_io_request_get_physical_address(
288 SCI_CONTROLLER_HANDLE_T controller,
289 SCI_IO_REQUEST_HANDLE_T io_request,
290 void * virtual_address,
291 SCI_PHYSICAL_ADDRESS * physical_address
293 #endif // SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED
296 * @brief This callback method asks the user to provide the number of
297 * bytes to be transferred as part of this request.
299 * @param[in] scic_user_io_request This parameter points to the user's
300 * IO request object. It is a cookie that allows the user to
301 * provide the necessary information for this callback.
303 * @return This method returns the number of payload data bytes to be
304 * transferred for this IO request.
306 U32 scic_cb_io_request_get_transfer_length(
307 void * scic_user_io_request
311 * @brief This callback method asks the user to provide the data direction
314 * @param[in] scic_user_io_request This parameter points to the user's
315 * IO request object. It is a cookie that allows the user to
316 * provide the necessary information for this callback.
318 * @return This method returns the value of SCI_IO_REQUEST_DATA_OUT or
319 * SCI_IO_REQUEST_DATA_IN, or SCI_IO_REQUEST_NO_DATA.
321 SCI_IO_REQUEST_DATA_DIRECTION scic_cb_io_request_get_data_direction(
322 void * scic_user_io_request
325 #ifdef ENABLE_OSSL_COPY_BUFFER
327 * @brief This method is presently utilized in the PIO path,
328 * copies from UF buffer to the SGL buffer. This method
329 * can be served for other OS related copies.
331 * @param[in] scic_user_io_request. This parameter points to the user's
332 * IO request object. It is a cookie that allows the user to
333 * provide the necessary information for this callback.
334 * @param[in] source addr. Address of UF buffer.
335 * @param[in] offset. This parameter specifies the offset into the data
336 * buffers pointed to by the SGL. The byte offset starts at 0
337 * and continues until the last byte pointed to be the last SGL
339 * @param[in] length. data length
343 void scic_cb_io_request_copy_buffer(
344 void * scic_user_io_request,
351 #ifndef SCI_SGL_OPTIMIZATION_ENABLED
353 * @brief This callback method asks the user to provide the address
354 * to where the next Scatter-Gather Element is located.
356 * Details regarding usage:
357 * - Regarding the first SGE: the user should initialize an index,
358 * or a pointer, prior to construction of the request that will
359 * reference the very first scatter-gather element. This is
360 * important since this method is called for every scatter-gather
361 * element, including the first element.
362 * - Regarding the last SGE: the user should return NULL from this
363 * method when this method is called and the SGL has exhausted
366 * @param[in] scic_user_io_request This parameter points to the user's
367 * IO request object. It is a cookie that allows the user to
368 * provide the necessary information for this callback.
369 * @param[in] current_sge_address This parameter specifies the address for
370 * the current SGE (i.e. the one that has just processed).
371 * @param[out] next_sge An address specifying the location for the next
372 * scatter gather element to be processed.
376 void scic_cb_io_request_get_next_sge(
377 void * scic_user_io_request,
378 void * current_sge_address,
381 #endif // SCI_SGL_OPTIMIZATION_ENABLED
384 * @brief This callback method asks the user to provide the contents of the
385 * "address" field in the Scatter-Gather Element.
387 * @param[in] scic_user_io_request This parameter points to the user's
388 * IO request object. It is a cookie that allows the user to
389 * provide the necessary information for this callback.
390 * @param[in] sge_address This parameter specifies the address for the
391 * SGE from which to retrieve the address field.
393 * @return A physical address specifying the contents of the SGE's address
396 SCI_PHYSICAL_ADDRESS scic_cb_sge_get_address_field(
397 void * scic_user_io_request,
402 * @brief This callback method asks the user to provide the contents of the
403 * "length" field in the Scatter-Gather Element.
405 * @param[in] scic_user_io_request This parameter points to the user's
406 * IO request object. It is a cookie that allows the user to
407 * provide the necessary information for this callback.
408 * @param[in] sge_address This parameter specifies the address for the
409 * SGE from which to retrieve the address field.
411 * @return This method returns the length field specified inside the SGE
412 * referenced by the sge_address parameter.
414 U32 scic_cb_sge_get_length_field(
415 void * scic_user_io_request,
420 * @brief This callback method asks the user to provide the address for
421 * the command descriptor block (CDB) associated with this IO request.
423 * @param[in] scic_user_io_request This parameter points to the user's
424 * IO request object. It is a cookie that allows the user to
425 * provide the necessary information for this callback.
427 * @return This method returns the virtual address of the CDB.
429 void * scic_cb_ssp_io_request_get_cdb_address(
430 void * scic_user_io_request
434 * @brief This callback method asks the user to provide the length of
435 * the command descriptor block (CDB) associated with this IO request.
437 * @param[in] scic_user_io_request This parameter points to the user's
438 * IO request object. It is a cookie that allows the user to
439 * provide the necessary information for this callback.
441 * @return This method returns the length of the CDB.
443 U32 scic_cb_ssp_io_request_get_cdb_length(
444 void * scic_user_io_request
448 * @brief This callback method asks the user to provide the Logical Unit (LUN)
449 * associated with this IO request.
451 * @note The contents of the value returned from this callback are defined
452 * by the protocol standard (e.g. T10 SAS specification). Please
453 * refer to the transport command information unit description
454 * in the associated standard.
456 * @param[in] scic_user_io_request This parameter points to the user's
457 * IO request object. It is a cookie that allows the user to
458 * provide the necessary information for this callback.
460 * @return This method returns the LUN associated with this request.
461 * @todo This should be U64?
463 U32 scic_cb_ssp_io_request_get_lun(
464 void * scic_user_io_request
468 * @brief This callback method asks the user to provide the task attribute
469 * associated with this IO request.
471 * @note The contents of the value returned from this callback are defined
472 * by the protocol standard (e.g. T10 SAS specification). Please
473 * refer to the transport command information unit description
474 * in the associated standard.
476 * @param[in] scic_user_io_request This parameter points to the user's
477 * IO request object. It is a cookie that allows the user to
478 * provide the necessary information for this callback.
480 * @return This method returns the task attribute associated with this
483 U32 scic_cb_ssp_io_request_get_task_attribute(
484 void * scic_user_io_request
488 * @brief This callback method asks the user to provide the command priority
489 * associated with this IO request.
491 * @note The contents of the value returned from this callback are defined
492 * by the protocol standard (e.g. T10 SAS specification). Please
493 * refer to the transport command information unit description
494 * in the associated standard.
496 * @param[in] scic_user_io_request This parameter points to the user's
497 * IO request object. It is a cookie that allows the user to
498 * provide the necessary information for this callback.
500 * @return This method returns the command priority associated with this
503 U32 scic_cb_ssp_io_request_get_command_priority(
504 void * scic_user_io_request
508 * @brief This callback method asks the user if the received RX frame data is
509 * to be copied to the SGL or should be stored by the SCI core to be
510 * retrieved later with the scic_io_request_get_rx_frame().
512 * @param[in] scic_user_io_request This parameter points to the user's IO
513 * request object. It is a cookie that allows the user to provide the
514 * necessary information for this callback.
516 * @return This method returns TRUE if the SCI core should copy the received
517 * frame data to the SGL location or FALSE if the SCI user wants to
518 * retrieve the frame data at a later time.
520 BOOL scic_cb_io_request_do_copy_rx_frames(
521 void * scic_user_io_request
525 * @brief This callback method asks the user to return the SAT protocol
526 * definition for this IO request. This method is only called by the
527 * SCI core if the request type constructed is SATA.
529 * @param[in] scic_user_io_request This parameter points to the user's IO
530 * request object. It is a cookie that allows the user to provide the
531 * necessary information for this callback.
533 * @return This method returns one of the sat.h defined protocols for the
536 U8 scic_cb_request_get_sat_protocol(
537 void * scic_user_io_request
541 * @brief This callback method asks the user to indicate if the IO is initially
542 * constructed or is reconstructed using the recycled memory.
544 * @param[in] scic_user_io_request This parameter points to the user's IO
545 * request object. It is a cookie that allows the user to provide the
546 * necessary information for this callback.
548 * @return This method returns TRUE if the request is initial constructed.
549 * This method returns FALSE if the request is constructed using recycled
550 * memory. For many scic user, this method mostly always returns TRUE.
552 BOOL scic_cb_request_is_initial_construction(
553 void * scic_user_io_request
557 * @brief This method returns the Logical Unit to be utilized for this
558 * task management request.
560 * @note The contents of the value returned from this callback are defined
561 * by the protocol standard (e.g. T10 SAS specification). Please
562 * refer to the transport task information unit description
563 * in the associated standard.
565 * @param[in] scic_user_task_request This parameter points to the user's
566 * task request object. It is a cookie that allows the user to
567 * provide the necessary information for this callback.
569 * @return This method returns the LUN associated with this request.
570 * @todo This should be U64?
572 U32 scic_cb_ssp_task_request_get_lun(
573 void * scic_user_task_request
577 * @brief This method returns the task management function to be utilized
578 * for this task request.
580 * @note The contents of the value returned from this callback are defined
581 * by the protocol standard (e.g. T10 SAS specification). Please
582 * refer to the transport task information unit description
583 * in the associated standard.
585 * @param[in] scic_user_task_request This parameter points to the user's
586 * task request object. It is a cookie that allows the user to
587 * provide the necessary information for this callback.
589 * @return This method returns an unsigned byte representing the task
590 * management function to be performed.
592 U8 scic_cb_ssp_task_request_get_function(
593 void * scic_user_task_request
597 * @brief This method returns the task management IO tag to be managed.
598 * Depending upon the task management function the value returned
599 * from this method may be ignored.
601 * @param[in] scic_user_task_request This parameter points to the user's
602 * task request object. It is a cookie that allows the user to
603 * provide the necessary information for this callback.
605 * @return This method returns an unsigned 16-bit word depicting the IO
608 U16 scic_cb_ssp_task_request_get_io_tag_to_manage(
609 void * scic_user_task_request
613 * @brief This callback method asks the user to provide the virtual
614 * address of the response data buffer for the supplied IO request.
616 * @param[in] scic_user_task_request This parameter points to the user's
617 * task request object. It is a cookie that allows the user to
618 * provide the necessary information for this callback.
620 * @return This method returns the virtual address for the response data buffer
621 * associated with this IO request.
623 void * scic_cb_ssp_task_request_get_response_data_address(
624 void * scic_user_task_request
628 * @brief This callback method asks the user to provide the length of the
629 * response data buffer for the supplied IO request.
631 * @param[in] scic_user_task_request This parameter points to the user's
632 * task request object. It is a cookie that allows the user to
633 * provide the necessary information for this callback.
635 * @return This method returns the length of the response buffer data
636 * associated with this IO request.
638 U32 scic_cb_ssp_task_request_get_response_data_length(
639 void * scic_user_task_request
643 * @brief In this method the user is expected to log the supplied
644 * error information. The user must be capable of handling variable
645 * length argument lists and should consider prepending the fact
646 * that this is an error from the core.
648 * @param[in] logger_object This parameter specifies the logger object
649 * associated with this message.
650 * @param[in] log_object_mask This parameter specifies the log objects
651 * for which this message is being generated.
652 * @param[in] log_message This parameter specifies the message to be logged.
656 void scic_cb_logger_log_error(
657 SCI_LOGGER_HANDLE_T logger_object,
665 * @brief In this method the user is expected to log the supplied warning
666 * information. The user must be capable of handling variable
667 * length argument lists and should consider prepending the fact
668 * that this is a warning from the core.
670 * @param[in] logger_object This parameter specifies the logger object
671 * associated with this message.
672 * @param[in] log_object_mask This parameter specifies the log objects
673 * for which this message is being generated.
674 * @param[in] log_message This parameter specifies the message to be logged.
678 void scic_cb_logger_log_warning(
679 SCI_LOGGER_HANDLE_T logger_object,
687 * @brief In this method the user is expected to log the supplied debug
688 * information. The user must be capable of handling variable
689 * length argument lists and should consider prepending the fact
690 * that this is a debug message from the core.
692 * @param[in] logger_object This parameter specifies the logger object
693 * associated with this message.
694 * @param[in] log_object_mask This parameter specifies the log objects
695 * for which this message is being generated.
696 * @param[in] log_message This parameter specifies the message to be logged.
700 void scic_cb_logger_log_info(
701 SCI_LOGGER_HANDLE_T logger_object,
709 * @brief In this method the user is expected to log the supplied function
710 * trace information. The user must be capable of handling variable
711 * length argument lists and should consider prepending the fact
712 * that this is a function trace (i.e. entry/exit) message from the
715 * @param[in] logger_object This parameter specifies the logger object
716 * associated with this message.
717 * @param[in] log_object_mask This parameter specifies the log objects
718 * for which this message is being generated.
719 * @param[in] log_message This parameter specifies the message to be logged.
723 void scic_cb_logger_log_trace(
724 SCI_LOGGER_HANDLE_T logger_object,
732 * @brief In this method the user is expected to log the supplied state
733 * transition information. The user must be capable of handling
734 * variable length argument lists and should consider prepending the
735 * fact that this is a warning from the core.
737 * @param[in] logger_object This parameter specifies the logger object
738 * associated with this message.
739 * @param[in] log_object_mask This parameter specifies the log objects
740 * for which this message is being generated.
741 * @param[in] log_message This parameter specifies the message to be logged.
745 void scic_cb_logger_log_states(
746 SCI_LOGGER_HANDLE_T logger_object,
754 * @brief In this method the user must return the base address register (BAR)
755 * value for the supplied base address register number.
757 * @param[in] controller The controller for which to retrieve the bar number.
758 * @param[in] bar_number This parameter depicts the BAR index/number to be read.
760 * @return Return a pointer value indicating the contents of the BAR.
761 * @retval NULL indicates an invalid BAR index/number was specified.
762 * @retval All other values indicate a valid VIRTUAL address from the BAR.
764 void * scic_cb_pci_get_bar(
765 SCI_CONTROLLER_HANDLE_T controller,
770 * @brief In this method the user must read from PCI memory via access.
771 * This method is used for access to memory space and IO space.
773 * @param[in] controller The controller for which to read a DWORD.
774 * @param[in] address This parameter depicts the address from
777 * @return The value being returned from the PCI memory location.
779 * @todo This PCI memory access calls likely need to be optimized into macro?
781 U32 scic_cb_pci_read_dword(
782 SCI_CONTROLLER_HANDLE_T controller,
787 * @brief In this method the user must write to PCI memory via access.
788 * This method is used for access to memory space and IO space.
790 * @param[in] controller The controller for which to read a DWORD.
791 * @param[in] address This parameter depicts the address into
793 * @param[out] write_value This parameter depicts the value being written
794 * into the PCI memory location.
796 * @todo This PCI memory access calls likely need to be optimized into macro?
798 void scic_cb_pci_write_dword(
799 SCI_CONTROLLER_HANDLE_T controller,
805 * @brief This method informs the user when a stop operation on the port
808 * @param[in] controller This parameter represents the controller which
810 * @param[in] port This parameter specifies the SCI port object for which
811 * the callback is being invoked.
812 * @param[in] completion_status This parameter specifies the status for
813 * the operation being completed.
817 void scic_cb_port_stop_complete(
818 SCI_CONTROLLER_HANDLE_T controller,
819 SCI_PORT_HANDLE_T port,
820 SCI_STATUS completion_status
824 * @brief This method informs the user when a hard reset on the port
825 * has completed. This hard reset could have been initiated by the
826 * user or by the remote port.
828 * @param[in] controller This parameter represents the controller which
830 * @param[in] port This parameter specifies the SCI port object for which
831 * the callback is being invoked.
832 * @param[in] completion_status This parameter specifies the status for
833 * the operation being completed.
837 void scic_cb_port_hard_reset_complete(
838 SCI_CONTROLLER_HANDLE_T controller,
839 SCI_PORT_HANDLE_T port,
840 SCI_STATUS completion_status
844 * @brief This method informs the user that the port is now in a ready
845 * state and can be utilized to issue IOs.
847 * @param[in] controller This parameter represents the controller which
849 * @param[in] port This parameter specifies the SCI port object for which
850 * the callback is being invoked.
854 void scic_cb_port_ready(
855 SCI_CONTROLLER_HANDLE_T controller,
856 SCI_PORT_HANDLE_T port
860 * @brief This method informs the user that the port is now not in a ready
861 * (i.e. busy) state and can't be utilized to issue IOs.
863 * @param[in] controller This parameter represents the controller which
865 * @param[in] port This parameter specifies the SCI port object for which
866 * the callback is being invoked.
867 * @param[in] reason_code This parameter specifies the reason for the port
868 * not ready callback.
872 void scic_cb_port_not_ready(
873 SCI_CONTROLLER_HANDLE_T controller,
874 SCI_PORT_HANDLE_T port,
879 * @brief This method informs the SCI Core user that a phy/link became
880 * ready, but the phy is not allowed in the port. In some
881 * situations the underlying hardware only allows for certain phy
882 * to port mappings. If these mappings are violated, then this
885 * @param[in] controller This parameter represents the controller which
887 * @param[in] port This parameter specifies the SCI port object for which
888 * the callback is being invoked.
889 * @param[in] phy This parameter specifies the phy that came ready, but the
890 * phy can't be a valid member of the port.
894 void scic_cb_port_invalid_link_up(
895 SCI_CONTROLLER_HANDLE_T controller,
896 SCI_PORT_HANDLE_T port,
901 * @brief This callback method informs the user that a broadcast change
902 * primitive was received.
904 * @param[in] controller This parameter represents the controller which
906 * @param[in] port This parameter specifies the SCI port object for which
907 * the callback is being invoked. For instances where the phy
908 * on which the primitive was received is not part of a port, this
909 * parameter will be SCI_INVALID_HANDLE_T.
910 * @param[in] phy This parameter specifies the phy on which the primitive
915 void scic_cb_port_bc_change_primitive_recieved(
916 SCI_CONTROLLER_HANDLE_T controller,
917 SCI_PORT_HANDLE_T port,
922 * @brief This callback method informs the user that a broadcast SES
923 * primitive was received.
925 * @param[in] controller This parameter represents the controller which
927 * @param[in] port This parameter specifies the SCI port object for which
928 * the callback is being invoked. For instances where the phy
929 * on which the primitive was received is not part of a port, this
930 * parameter will be SCI_INVALID_HANDLE_T.
931 * @param[in] phy This parameter specifies the phy on which the primitive
936 void scic_cb_port_bc_ses_primitive_recieved(
937 SCI_CONTROLLER_HANDLE_T controller,
938 SCI_PORT_HANDLE_T port,
943 * @brief This callback method informs the user that a broadcast EXPANDER
944 * primitive was received.
946 * @param[in] controller This parameter represents the controller which
948 * @param[in] port This parameter specifies the SCI port object for which
949 * the callback is being invoked. For instances where the phy
950 * on which the primitive was received is not part of a port, this
951 * parameter will be SCI_INVALID_HANDLE_T.
952 * @param[in] phy This parameter specifies the phy on which the primitive
957 void scic_cb_port_bc_expander_primitive_recieved(
958 SCI_CONTROLLER_HANDLE_T controller,
959 SCI_PORT_HANDLE_T port,
964 * @brief This callback method informs the user that a broadcast ASYNCHRONOUS
965 * EVENT (AEN) primitive was received.
967 * @param[in] controller This parameter represents the controller which
969 * @param[in] port This parameter specifies the SCI port object for which
970 * the callback is being invoked. For instances where the phy
971 * on which the primitive was received is not part of a port, this
972 * parameter will be SCI_INVALID_HANDLE_T.
973 * @param[in] phy This parameter specifies the phy on which the primitive
978 void scic_cb_port_bc_aen_primitive_recieved(
979 SCI_CONTROLLER_HANDLE_T controller,
980 SCI_PORT_HANDLE_T port,
985 * @brief This callback method informs the user that a phy has become
986 * operational and is capable of communicating with the remote end
989 * @param[in] controller This parameter represents the controller
990 * associated with the phy.
991 * @param[in] port This parameter specifies the port object for which the
992 * user callback is being invoked. There may be conditions where
993 * this parameter can be SCI_INVALID_HANDLE
994 * @param[in] phy This parameter specifies the phy object for which the
995 * user callback is being invoked.
999 void scic_cb_port_link_up(
1000 SCI_CONTROLLER_HANDLE_T controller,
1001 SCI_PORT_HANDLE_T port,
1002 SCI_PHY_HANDLE_T phy
1006 * @brief This callback method informs the user that a phy is no longer
1007 * operational and is not capable of communicating with the remote end
1010 * @param[in] controller This parameter represents the controller
1011 * associated with the phy.
1012 * @param[in] port This parameter specifies the port object for which the
1013 * user callback is being invoked. There may be conditions where
1014 * this parameter can be SCI_INVALID_HANDLE
1015 * @param[in] phy This parameter specifies the phy object for which the
1016 * user callback is being invoked.
1020 void scic_cb_port_link_down(
1021 SCI_CONTROLLER_HANDLE_T controller,
1022 SCI_PORT_HANDLE_T port,
1023 SCI_PHY_HANDLE_T phy
1027 * @brief This user callback method will inform the user that a start
1028 * operation has completed.
1030 * @param[in] controller This parameter specifies the core controller
1031 * associated with the completion callback.
1032 * @param[in] remote_device This parameter specifies the remote device
1033 * associated with the completion callback.
1034 * @param[in] completion_status This parameter specifies the completion
1035 * status for the operation.
1039 void scic_cb_remote_device_start_complete(
1040 SCI_CONTROLLER_HANDLE_T controller,
1041 SCI_REMOTE_DEVICE_HANDLE_T remote_device,
1042 SCI_STATUS completion_status
1046 * @brief This user callback method will inform the user that a stop
1047 * operation has completed.
1049 * @param[in] controller This parameter specifies the core controller
1050 * associated with the completion callback.
1051 * @param[in] remote_device This parameter specifies the remote device
1052 * associated with the completion callback.
1053 * @param[in] completion_status This parameter specifies the completion
1054 * status for the operation.
1058 void scic_cb_remote_device_stop_complete(
1059 SCI_CONTROLLER_HANDLE_T controller,
1060 SCI_REMOTE_DEVICE_HANDLE_T remote_device,
1061 SCI_STATUS completion_status
1065 * @brief This user callback method will inform the user that a remote
1066 * device is now capable of handling IO requests.
1068 * @param[in] controller This parameter specifies the core controller
1069 * associated with the completion callback.
1070 * @param[in] remote_device This parameter specifies the remote device
1071 * associated with the callback.
1075 void scic_cb_remote_device_ready(
1076 SCI_CONTROLLER_HANDLE_T controller,
1077 SCI_REMOTE_DEVICE_HANDLE_T remote_device
1081 * @brief This user callback method will inform the user that a remote
1082 * device is no longer capable of handling IO requests (until a
1083 * ready callback is invoked).
1085 * @param[in] controller This parameter specifies the core controller
1086 * associated with the completion callback.
1087 * @param[in] remote_device This parameter specifies the remote device
1088 * associated with the callback.
1089 * @param[in] reason_code This paramete specifies the reason the remote
1090 * device is not ready.
1094 void scic_cb_remote_device_not_ready(
1095 SCI_CONTROLLER_HANDLE_T controller,
1096 SCI_REMOTE_DEVICE_HANDLE_T remote_device,
1102 * @brief This user callback method will inform the user that this controller
1103 * is having unexpected error. The user can choose to reset the controller.
1104 * @param[in] controller The controller that is failed at the moment.
1108 void scic_cb_controller_error(
1109 SCI_CONTROLLER_HANDLE_T controller,
1110 SCI_CONTROLLER_ERROR error
1114 #if !defined(DISABLE_ATAPI)
1116 * @brief This user callback gets from stp packet io's user request
1118 * @param[in] scic_user_io_request
1120 * @return The cdb address.
1122 void * scic_cb_stp_packet_io_request_get_cdb_address(
1123 void * scic_user_io_request
1127 * @brief This user callback gets from stp packet io's user request
1129 * @param[in] scic_user_io_request
1131 * @return The cdb length.
1133 U32 scic_cb_stp_packet_io_request_get_cdb_length(
1134 void * scic_user_io_request
1136 #else //!defined(DISABLE_ATAPI)
1137 #define scic_cb_stp_packet_io_request_get_cdb_address(scic_user_io_request) NULL
1138 #define scic_cb_stp_packet_io_request_get_cdb_length(scic_user_io_request) 0
1139 #endif //!defined(DISABLE_ATAPI)
1143 #endif // __cplusplus
1145 #endif // _SCIC_USER_CALLBACK_H_