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.
53 #include <sys/cdefs.h>
54 __FBSDID("$FreeBSD$");
59 * @brief This file contains the implementation of the SCIF_SAS_IO_REQUEST
64 #include <dev/isci/scil/scic_io_request.h>
65 #include <dev/isci/scil/scic_remote_device.h>
66 #include <dev/isci/scil/scic_user_callback.h>
67 #include <dev/isci/scil/scic_controller.h>
68 #include <dev/isci/scil/scif_user_callback.h>
70 #include <dev/isci/scil/scif_sas_controller.h>
71 #include <dev/isci/scil/scif_sas_domain.h>
72 #include <dev/isci/scil/scif_sas_remote_device.h>
73 #include <dev/isci/scil/scif_sas_io_request.h>
74 #include <dev/isci/scil/scif_sas_task_request.h>
75 #include <dev/isci/scil/scif_sas_stp_io_request.h>
76 #include <dev/isci/scil/scif_sas_logger.h>
77 #include <dev/isci/scil/scif_sas_smp_io_request.h>
78 #include <dev/isci/scil/sci_fast_list.h>
79 #include <dev/isci/scil/sati.h>
80 #include <dev/isci/scil/intel_sat.h>
81 #include <dev/isci/scil/sati_translator_sequence.h>
84 * @brief This method represents common functionality for the
85 * scif_io_request_construct() and scif_sas_io_request_continue()
88 * @return This method returns an indication as to whether the
89 * construction succeeded.
92 SCI_STATUS scif_sas_io_request_construct(
93 SCIF_SAS_REMOTE_DEVICE_T * fw_device,
94 SCIF_SAS_IO_REQUEST_T * fw_io,
96 void * user_io_request_object,
97 SCI_IO_REQUEST_HANDLE_T * scif_io_request,
98 BOOL is_initial_construction
102 SMP_DISCOVER_RESPONSE_PROTOCOLS_T dev_protocols;
104 scic_remote_device_get_protocols(fw_device->core_object, &dev_protocols);
106 //Currently, all the io requests sent to smp target are internal.
107 //so we fail all the external io toward to it.
108 //Todo: is there a better way to handle external io to smp target?
109 if (dev_protocols.u.bits.attached_smp_target)
110 return SCI_FAILURE_INVALID_REMOTE_DEVICE;
113 sci_base_object_get_logger(fw_device),
114 SCIF_LOG_OBJECT_IO_REQUEST,
115 "scif_sas_io_request_construct(0x%x,0x%x,0x%x,0x%x,0x%x,0x%x) enter\n",
116 fw_device, fw_io, io_tag, user_io_request_object, scif_io_request,
117 is_initial_construction
120 // Initialize the users handle to the framework IO request.
121 *scif_io_request = fw_io;
123 // Construct the parent object first in order to ensure logging can
125 scif_sas_request_construct(
128 sci_base_object_get_logger(fw_device),
129 scif_sas_io_request_state_table
132 status = scic_io_request_construct(
133 fw_device->domain->controller->core_object,
134 fw_device->core_object,
137 ((U8 *)fw_io) + sizeof(SCIF_SAS_IO_REQUEST_T),
138 &fw_io->parent.core_object
141 if (status == SCI_SUCCESS)
143 // These associations must be set early for the core io request
144 // object construction to complete correctly as there will be
145 // callbacks into the user driver framework during core construction
146 sci_object_set_association(fw_io, user_io_request_object);
147 sci_object_set_association(fw_io->parent.core_object, fw_io);
149 // Perform protocol specific core IO request construction.
150 if (dev_protocols.u.bits.attached_ssp_target)
151 status = scic_io_request_construct_basic_ssp(fw_io->parent.core_object);
152 else if (dev_protocols.u.bits.attached_stp_target)
154 if (is_initial_construction == TRUE)
155 sati_sequence_construct(&fw_io->parent.stp.sequence);
157 #if !defined(DISABLE_ATAPI)
158 if (!scic_remote_device_is_atapi(fw_device->core_object))
161 status = scif_sas_stp_io_request_construct(fw_io);
163 #if !defined(DISABLE_ATAPI)
166 status = scif_sas_stp_packet_io_request_construct(fw_io);
170 sci_base_state_machine_logger_initialize(
171 &fw_io->parent.parent.state_machine_logger,
172 &fw_io->parent.parent.state_machine,
173 &fw_io->parent.parent.parent,
174 scif_cb_logger_log_states,
175 "SCIF_IO_REQUEST_T", "base_state_machine",
176 SCIF_LOG_OBJECT_IO_REQUEST
183 //******************************************************************************
184 //* P U B L I C M E T H O D S
185 //******************************************************************************
187 U32 scif_io_request_get_object_size(
191 return (sizeof(SCIF_SAS_IO_REQUEST_T) + scic_io_request_get_object_size());
194 // ----------------------------------------------------------------------------
195 U32 scif_io_request_get_number_of_bytes_transferred(
196 SCI_IO_REQUEST_HANDLE_T scif_io_request
199 SCIF_SAS_IO_REQUEST_T * fw_request = (SCIF_SAS_IO_REQUEST_T*) scif_io_request;
201 if(scic_io_request_get_protocol(scif_io_request_get_scic_handle(scif_io_request))
202 == SCIC_STP_PROTOCOL)
204 U16 sati_data_bytes_set =
205 sati_get_number_data_bytes_set(&(fw_request->parent.stp.sequence));
207 if (sati_data_bytes_set != 0)
208 return sati_data_bytes_set;
211 #if !defined(DISABLE_ATAPI)
212 U8 sat_protocol = fw_request->parent.stp.sequence.protocol;
213 if ( sat_protocol & SAT_PROTOCOL_PACKET)
215 scif_sas_stp_packet_io_request_get_number_of_bytes_transferred(fw_request);
218 return scic_io_request_get_number_of_bytes_transferred(
219 scif_io_request_get_scic_handle(scif_io_request));
224 return scic_io_request_get_number_of_bytes_transferred(
225 scif_io_request_get_scic_handle(scif_io_request));
229 // ---------------------------------------------------------------------------
231 SCI_STATUS scif_io_request_construct(
232 SCI_CONTROLLER_HANDLE_T scif_controller,
233 SCI_REMOTE_DEVICE_HANDLE_T scif_remote_device,
235 void * user_io_request_object,
236 void * io_request_memory,
237 SCI_IO_REQUEST_HANDLE_T * scif_io_request
240 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
242 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
245 return scif_sas_io_request_construct(
249 user_io_request_object,
255 // ---------------------------------------------------------------------------
257 SCI_STATUS scif_request_construct(
258 SCI_CONTROLLER_HANDLE_T scif_controller,
259 SCI_REMOTE_DEVICE_HANDLE_T scif_remote_device,
261 void * user_io_request_object,
262 void * io_request_memory,
263 SCI_IO_REQUEST_HANDLE_T * scif_io_request
266 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
268 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
273 sci_base_object_get_logger(fw_device),
274 SCIF_LOG_OBJECT_IO_REQUEST,
275 "scif_io_request_construct(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x) enter\n",
276 scif_controller, scif_remote_device, io_tag, user_io_request_object,
277 io_request_memory, scif_io_request
280 // Step 1: Create the scif io request.
281 // Initialize the users handle to the framework IO request.
282 *scif_io_request = fw_io;
284 // Construct the parent object first in order to ensure logging can
286 scif_sas_request_construct(
289 sci_base_object_get_logger(fw_device),
290 scif_sas_io_request_state_table
293 status = scic_io_request_construct(
294 (void *) ((SCIF_SAS_CONTROLLER_T *)scif_controller)->core_object,
295 (void *) fw_device->core_object,
298 (U8 *)io_request_memory + sizeof(SCIF_SAS_IO_REQUEST_T),
299 &fw_io->parent.core_object
302 if (status == SCI_SUCCESS)
304 // These associations must be set early for the core io request
305 // object construction to complete correctly as there will be
306 // callbacks into the user driver framework during core construction
307 sci_object_set_association(fw_io, user_io_request_object);
308 sci_object_set_association(fw_io->parent.core_object, fw_io);
310 sci_base_state_machine_logger_initialize(
311 &fw_io->parent.parent.state_machine_logger,
312 &fw_io->parent.parent.state_machine,
313 &fw_io->parent.parent.parent,
314 scif_cb_logger_log_states,
315 "SCIF_IO_REQUEST_T", "base_state_machine",
316 SCIF_LOG_OBJECT_IO_REQUEST
323 // ----------------------------------------------------------------------------
325 SCI_STATUS scif_io_request_construct_with_core (
326 SCI_CONTROLLER_HANDLE_T scif_controller,
327 SCI_REMOTE_DEVICE_HANDLE_T scif_remote_device,
328 void * scic_io_request,
329 void * user_io_request_object,
330 void * io_request_memory,
331 SCI_IO_REQUEST_HANDLE_T * scif_io_request
334 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
336 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
338 SCI_STATUS status = SCI_SUCCESS;
341 sci_base_object_get_logger(fw_device),
342 SCIF_LOG_OBJECT_IO_REQUEST,
343 "scif_io_request_construct_pass_through(0x%x, 0x%x, 0x%x, 0x%x) enter\n",
344 scif_remote_device, user_io_request_object,
345 io_request_memory, scif_io_request
348 // Initialize the users handle to the framework IO request.
349 *scif_io_request = fw_io;
351 // Construct the parent object first in order to ensure logging can
353 scif_sas_request_construct(
356 sci_base_object_get_logger(fw_device),
357 scif_sas_io_request_state_table
360 fw_io->parent.core_object = scic_io_request;
363 sci_object_set_association(fw_io, user_io_request_object);
364 sci_object_set_association(fw_io->parent.core_object, fw_io);
367 sci_base_state_machine_logger_initialize(
368 &fw_io->parent.parent.state_machine_logger,
369 &fw_io->parent.parent.state_machine,
370 &fw_io->parent.parent.parent,
371 scif_cb_logger_log_states,
372 "SCIF_IO_REQUEST_T", "base_state_machine",
373 SCIF_LOG_OBJECT_IO_REQUEST
379 // ---------------------------------------------------------------------------
381 void * scif_io_request_get_response_iu_address(
382 SCI_IO_REQUEST_HANDLE_T scif_io_request
385 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)scif_io_request;
387 return (scic_io_request_get_response_iu_address(fw_io->parent.core_object ));
390 // ---------------------------------------------------------------------------
392 SCI_IO_REQUEST_HANDLE_T scif_io_request_get_scic_handle(
393 SCI_IO_REQUEST_HANDLE_T scif_io_request
396 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*) scif_io_request;
397 return fw_io->parent.core_object;
400 // ---------------------------------------------------------------------------
402 void scic_cb_io_request_complete(
403 SCI_CONTROLLER_HANDLE_T controller,
404 SCI_REMOTE_DEVICE_HANDLE_T remote_device,
405 SCI_IO_REQUEST_HANDLE_T io_request,
406 SCI_IO_STATUS completion_status
410 SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*)
411 sci_object_get_association(controller);
412 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
413 sci_object_get_association(remote_device);
414 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*)
415 sci_object_get_association(io_request);
418 sci_base_object_get_logger(controller),
419 SCIF_LOG_OBJECT_IO_REQUEST,
420 "scic_cb_io_request_complete(0x%x, 0x%x, 0x%x, 0x%x) enter\n",
421 controller, remote_device, io_request, completion_status
424 // Invoke the common completion handler routine.
425 // A non-successful return indicates we are not in a correct state to
426 // receive a completion notification for this request.
427 status = fw_request->state_handlers->complete_handler(&fw_request->parent);
429 // If the status indicates the completion handler was successful, then
430 // allow protocol specific completion processing to occur.
431 if (status == SCI_SUCCESS)
433 if (fw_request->protocol_complete_handler != NULL)
435 status = fw_request->protocol_complete_handler(
436 fw_controller, fw_device, fw_request, (SCI_STATUS *)&completion_status
440 // If this isn't an internal framework IO request, then simply pass the
441 // notification up to the SCIF user.
442 if ( status == SCI_SUCCESS )
444 if (fw_request->is_high_priority == FALSE)
446 if (fw_request->is_waiting_for_abort_task_set == FALSE)
448 scif_cb_io_request_complete(
449 fw_controller, fw_device, fw_request, completion_status);
453 // do nothing - will complete the I/O when the abort task
458 scif_sas_controller_complete_high_priority_io(
459 fw_controller, fw_device, fw_request);
461 else if ( status == SCI_WARNING_SEQUENCE_INCOMPLETE )
463 scif_sas_io_request_continue(fw_controller, fw_device, fw_request);
468 // ---------------------------------------------------------------------------
470 U32 scic_cb_io_request_get_transfer_length(
471 void * scic_user_io_request
474 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
475 scic_user_io_request;
477 return (scif_cb_io_request_get_transfer_length(
478 fw_io->parent.parent.parent.associated_object
482 // ---------------------------------------------------------------------------
484 SCI_IO_REQUEST_DATA_DIRECTION scic_cb_io_request_get_data_direction(
485 void * scic_user_io_request
488 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
489 scic_user_io_request;
491 return (scif_cb_io_request_get_data_direction(
492 fw_io->parent.parent.parent.associated_object
496 // ---------------------------------------------------------------------------
497 #ifndef SCI_SGL_OPTIMIZATION_ENABLED
498 void scic_cb_io_request_get_next_sge(
499 void * scic_user_io_request,
500 void * current_sge_address,
504 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
505 scic_user_io_request;
507 scif_cb_io_request_get_next_sge(
508 fw_io->parent.parent.parent.associated_object,
515 // ---------------------------------------------------------------------------
517 SCI_PHYSICAL_ADDRESS scic_cb_sge_get_address_field(
518 void * scic_user_io_request,
522 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
523 scic_user_io_request;
524 return scif_cb_sge_get_address_field(
525 fw_io->parent.parent.parent.associated_object, sge_address
529 // ---------------------------------------------------------------------------
531 U32 scic_cb_sge_get_length_field(
532 void * scic_user_io_request,
536 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
537 scic_user_io_request;
539 return scif_cb_sge_get_length_field(
540 fw_io->parent.parent.parent.associated_object,
545 // ---------------------------------------------------------------------------
547 void * scic_cb_ssp_io_request_get_cdb_address(
548 void * scic_user_io_request
551 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
552 scic_user_io_request;
554 return scif_cb_io_request_get_cdb_address(
555 fw_io->parent.parent.parent.associated_object
559 // ---------------------------------------------------------------------------
561 U32 scic_cb_ssp_io_request_get_cdb_length(
562 void * scic_user_io_request
565 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
566 scic_user_io_request;
568 return scif_cb_io_request_get_cdb_length(
569 fw_io->parent.parent.parent.associated_object
573 // ---------------------------------------------------------------------------
575 #if !defined(DISABLE_ATAPI)
576 void * scic_cb_stp_packet_io_request_get_cdb_address(
577 void * scic_user_io_request
580 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*)scic_user_io_request;
582 SATI_TRANSLATOR_SEQUENCE_T * sati_sequence = &fw_request->stp.sequence;
584 if (sati_sequence->state != SATI_SEQUENCE_STATE_INCOMPLETE)
585 return scif_cb_io_request_get_cdb_address(
586 fw_request->parent.parent.associated_object
590 &(sati_sequence->command_specific_data.sati_atapi_data.request_sense_cdb);
594 // ---------------------------------------------------------------------------
596 #if !defined(DISABLE_ATAPI)
597 U32 scic_cb_stp_packet_io_request_get_cdb_length(
598 void * scic_user_io_request
601 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*)
602 scic_user_io_request;
604 SATI_TRANSLATOR_SEQUENCE_T * sati_sequence = &fw_request->stp.sequence;
606 if (sati_sequence->state != SATI_SEQUENCE_STATE_INCOMPLETE)
607 return scif_cb_io_request_get_cdb_length(
608 fw_request->parent.parent.associated_object
611 return SATI_ATAPI_REQUEST_SENSE_CDB_LENGTH;
615 // ---------------------------------------------------------------------------
617 U32 scic_cb_ssp_io_request_get_lun(
618 void * scic_user_io_request
621 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
622 scic_user_io_request;
624 return scif_cb_io_request_get_lun(
625 fw_io->parent.parent.parent.associated_object
629 // ---------------------------------------------------------------------------
631 U32 scic_cb_ssp_io_request_get_task_attribute(
632 void * scic_user_io_request
635 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
636 scic_user_io_request;
638 return scif_cb_io_request_get_task_attribute(
639 fw_io->parent.parent.parent.associated_object
643 // ---------------------------------------------------------------------------
645 U32 scic_cb_ssp_io_request_get_command_priority(
646 void * scic_user_io_request
649 SCIF_SAS_IO_REQUEST_T * fw_io = (SCIF_SAS_IO_REQUEST_T*)
650 scic_user_io_request;
652 return scif_cb_io_request_get_command_priority(
653 fw_io->parent.parent.parent.associated_object
657 // ---------------------------------------------------------------------------
659 BOOL scic_cb_request_is_initial_construction(
660 void * scic_user_io_request
663 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*)
664 scic_user_io_request;
665 SCIF_SAS_REMOTE_DEVICE_T* fw_device = fw_request->device;
667 SMP_DISCOVER_RESPONSE_PROTOCOLS_T dev_protocols;
668 scic_remote_device_get_protocols(fw_device->core_object, &dev_protocols);
670 if (dev_protocols.u.bits.attached_stp_target
671 && fw_request->stp.sequence.state == SATI_SEQUENCE_STATE_INCOMPLETE)
678 //******************************************************************************
679 //* P R O T E C T E D M E T H O D S
680 //******************************************************************************
682 * @brief This method constructs an scif sas smp request.
684 * @param[in] fw_controller The framework controller
685 * @param[in] fw_device The smp device that the smp request targets to.
686 * @param[in] fw_io_memory The memory space for the smp request.
687 * @param[in] core_io_memory The memory space for the core request.
688 * @param[in] io_tag The io tag for the internl io to be constructed.
689 * @param[in] smp_command A pointer to the smp request data structure according
692 * @return Indicate if the internal io was successfully constructed.
693 * @retval SCI_SUCCESS This value is returned if the internal io was
694 * successfully constructed.
695 * @retval SCI_FAILURE This value is returned if the internal io was failed to
698 SCI_STATUS scif_sas_io_request_construct_smp(
699 SCIF_SAS_CONTROLLER_T * fw_controller,
700 SCIF_SAS_REMOTE_DEVICE_T * fw_device,
702 void * core_io_memory,
704 SMP_REQUEST_T * smp_command,
705 void * user_request_object
708 SCIF_SAS_IO_REQUEST_T * fw_io =
709 (SCIF_SAS_IO_REQUEST_T*)fw_io_memory;
711 SCI_STATUS status = SCI_SUCCESS;
714 sci_base_object_get_logger(fw_device),
715 SCIF_LOG_OBJECT_IO_REQUEST,
716 "scif_sas_io_request_construct_smp(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x) enter\n",
726 // Construct the parent object first in order to ensure logging can
728 scif_sas_request_construct(
731 sci_base_object_get_logger(fw_controller),
732 scif_sas_io_request_state_table
735 status = scic_io_request_construct(
736 fw_device->domain->controller->core_object,
737 fw_device->core_object,
740 (U8 *)core_io_memory,
741 &fw_io->parent.core_object
744 if (status == SCI_SUCCESS)
746 //set object association.
747 sci_object_set_association(fw_io, user_request_object);
748 sci_object_set_association(fw_io->parent.core_object, fw_io);
750 scif_sas_smp_request_construct(&fw_io->parent, smp_command);
752 fw_io->parent.is_high_priority = TRUE;
754 sci_base_state_machine_logger_initialize(
755 &fw_io->parent.parent.state_machine_logger,
756 &fw_io->parent.parent.state_machine,
757 &fw_io->parent.parent.parent,
758 scif_cb_logger_log_states,
759 "SCIF_IO_REQUEST_T", "base_state_machine",
760 SCIF_LOG_OBJECT_IO_REQUEST
769 * @brief This method continues a scif sas request.
771 * @param[in] fw_controller The framework controller
772 * @param[in] fw_device The device that the IO request targets to.
773 * @param[in] fw_request The IO request to be continued.
775 * @return Indicate if the internal io was successfully constructed.
776 * @retval SCI_SUCCESS This value is returned if the internal io was
777 * successfully continued.
778 * @retval SCI_FAILURE This value is returned if the io was failed to
781 SCI_STATUS scif_sas_io_request_continue(
782 SCIF_SAS_CONTROLLER_T * fw_controller,
783 SCIF_SAS_REMOTE_DEVICE_T * fw_device,
784 SCIF_SAS_REQUEST_T * fw_request
787 SCI_IO_REQUEST_HANDLE_T dummy_handle;
790 sci_base_object_get_logger(fw_request),
791 SCIF_LOG_OBJECT_IO_REQUEST,
792 "scif_sas_io_request_continue(0x%x, 0x%x, 0x%x) enter\n",
798 //complete this io request in framework and core.
799 scif_controller_complete_io(fw_controller, fw_device, fw_request);
801 //construct next command in the sequence using the same memory. We pass
802 //a dummy pointer to let the framework user keep the pointer to this IO
804 scif_sas_io_request_construct(
806 (SCIF_SAS_IO_REQUEST_T*)fw_request,
807 SCI_CONTROLLER_INVALID_IO_TAG,
808 (void *)sci_object_get_association(fw_request),
813 //start the new constructed IO.
814 return (SCI_STATUS)scif_controller_start_io(
815 (SCI_CONTROLLER_HANDLE_T) fw_controller,
816 (SCI_REMOTE_DEVICE_HANDLE_T) fw_device,
817 (SCI_IO_REQUEST_HANDLE_T) fw_request,
818 SCI_CONTROLLER_INVALID_IO_TAG