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 all of the state handler routines for each
60 * of the domain states defined by the SCI_BASE_DOMAIN state
63 * - The discover method must be synchronized with the
64 * controller's completion handler. The OS specific driver
65 * component is responsible for ensuring this occurs. If the
66 * discovery method is called from within the call
67 * tree of the completion routine, then no action is necessary.
71 #include <dev/isci/scil/scic_port.h>
72 #include <dev/isci/scil/scic_io_request.h>
73 #include <dev/isci/scil/scif_sas_logger.h>
74 #include <dev/isci/scil/scif_sas_domain.h>
76 //******************************************************************************
77 //* P R O T E C T E D M E T H O D S
78 //******************************************************************************
80 //******************************************************************************
81 //* S T A R T I N G H A N D L E R S
82 //******************************************************************************
85 SCI_STATUS scif_sas_domain_starting_port_ready_handler(
86 SCI_BASE_DOMAIN_T * domain
90 sci_base_object_get_logger(domain),
91 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY,
92 "scif_sas_domain_starting_port_ready_handler(0x%x) enter\n",
96 // The domain was previously completely stopped. Now that the port is
97 // ready we can transition the domain to the ready state.
98 sci_base_state_machine_change_state(
99 &domain->state_machine, SCI_BASE_DOMAIN_STATE_READY
105 //******************************************************************************
106 //* R E A D Y H A N D L E R S
107 //******************************************************************************
110 * @brief This method provides READY state specific handling for
111 * when a user attempts to discover a domain.
113 * @param[in] domain This parameter specifies the domain object
114 * on which the user is attempting to perform a discover
117 * @return This method returns an indication of whether the discover operation
119 * @retval SCI_SUCCESSS This value is returned when the discover operation
120 * begins successfully.
123 SCI_STATUS scif_sas_domain_ready_discover_handler(
124 SCI_BASE_DOMAIN_T * domain,
129 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T *)domain;
132 sci_base_object_get_logger(domain),
133 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY,
134 "scif_sas_domain_ready_discover_handler(0x%x, 0x%x, 0x%x) enter\n",
135 domain, op_timeout, device_timeout
138 fw_domain->operation.timeout = op_timeout;
139 fw_domain->operation.device_timeout = device_timeout;
140 fw_domain->operation.status = SCI_SUCCESS;
143 fw_domain->controller,
144 fw_domain->operation.timer,
145 fw_domain->operation.timeout
148 scif_sas_domain_transition_to_discovering_state(fw_domain);
150 return fw_domain->operation.status;
154 * @brief This method provides READY state processing for reception of a
155 * port NOT ready notification from the core.
157 * @param[in] domain This parameter specifies the domain object
158 * on which the core port has just come ready.
163 SCI_STATUS scif_sas_domain_ready_port_not_ready_handler(
164 SCI_BASE_DOMAIN_T * domain,
169 sci_base_object_get_logger(domain),
170 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY,
171 "scif_sas_domain_ready_port_not_ready_handler(0x%x, 0x%x) enter\n",
176 if (reason_code != SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED)
178 // Change to the STOPPING state to cause existing request
179 // completions to be terminated and devices removed.
180 sci_base_state_machine_change_state(
181 &domain->state_machine, SCI_BASE_DOMAIN_STATE_STOPPING
189 * @brief This method provides READY state specific handling for
190 * when a user attempts to start an IO request.
192 * @param[in] domain This parameter specifies the domain object
193 * on which the user is attempting to perform a start IO
195 * @param[in] remote_device This parameter specifies the remote device
196 * object on which the user is attempting to perform a start IO
198 * @param[in] io_request This parameter specifies the io request that is
201 * @return This method returns an indication of whether the start IO
202 * operation succeeded.
203 * @retval SCI_SUCCESS This value is returned when the start IO operation
204 * begins successfully.
207 SCI_STATUS scif_sas_domain_ready_start_io_handler(
208 SCI_BASE_DOMAIN_T * domain,
209 SCI_BASE_REMOTE_DEVICE_T * remote_device,
210 SCI_BASE_REQUEST_T * io_request
213 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T*) domain;
214 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
216 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*) io_request;
220 sci_base_object_get_logger(domain),
221 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
222 "scif_sas_domain_ready_start_io_handler(0x%x, 0x%x, 0x%x) enter\n",
223 domain, remote_device, io_request
226 status = fw_device->state_handlers->parent.start_io_handler(
227 &fw_device->parent, &fw_request->parent
230 if (status == SCI_SUCCESS)
232 // Add the IO to the list of outstanding requests on the domain.
233 sci_fast_list_insert_tail(
234 &fw_domain->request_list, &fw_request->list_element
242 * @brief This method provides READY state specific handling for
243 * when a user attempts to complete an IO request.
245 * @param[in] domain This parameter specifies the domain object
246 * on which the user is attempting to perform a complete IO
248 * @param[in] remote_device This parameter specifies the remote device
249 * object on which the user is attempting to perform a complete
251 * @param[in] io_request This parameter specifies the io request that is
254 * @return This method returns an indication of whether the complete IO
255 * operation succeeded.
256 * @retval SCI_SUCCESS This value is returned when the complete IO operation
260 SCI_STATUS scif_sas_domain_ready_complete_io_handler(
261 SCI_BASE_DOMAIN_T * domain,
262 SCI_BASE_REMOTE_DEVICE_T * remote_device,
263 SCI_BASE_REQUEST_T * io_request
266 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
268 SCIF_SAS_REQUEST_T * fw_request= (SCIF_SAS_REQUEST_T*) io_request;
271 sci_base_object_get_logger(domain),
272 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
273 "scif_sas_domain_ready_complete_io_handler(0x%x, 0x%x, 0x%x) enter\n",
274 domain, remote_device, io_request
277 // Remove the IO from the list of outstanding requests on the domain.
278 sci_fast_list_remove_element(&fw_request->list_element);
280 return fw_device->state_handlers->parent.complete_io_handler(
281 &fw_device->parent, &fw_request->parent
286 * @brief This method provides READY state specific handling for
287 * when a user attempts to continue an IO request.
289 * @param[in] domain This parameter specifies the domain object
290 * on which the user is attempting to perform a continue IO
292 * @param[in] remote_device This parameter specifies the remote device
293 * object on which the user is attempting to perform a start IO
295 * @param[in] io_request This parameter specifies the io request that is
298 * @return This method returns an indication of whether the continue IO
299 * operation succeeded.
300 * @retval SCI_SUCCESS This value is returned when the continue IO operation
301 * begins successfully.
304 SCI_STATUS scif_sas_domain_ready_continue_io_handler(
305 SCI_BASE_DOMAIN_T * domain,
306 SCI_BASE_REMOTE_DEVICE_T * remote_device,
307 SCI_BASE_REQUEST_T * io_request
311 sci_base_object_get_logger(domain),
312 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
313 "scif_sas_domain_ready_continue_io_handler(0x%x, 0x%x, 0x%x) enter\n",
314 domain, remote_device, io_request
317 /// @todo fix return code handling.
322 * @brief This method provides READY state specific handling for
323 * when a user attempts to start a task request.
325 * @param[in] domain This parameter specifies the domain object
326 * on which the user is attempting to perform a start task
328 * @param[in] remote_device This parameter specifies the remote device
329 * object on which the user is attempting to perform a start IO
331 * @param[in] task_request This parameter specifies the task request that
334 * @return This method returns an indication of whether the start task
335 * operation succeeded.
336 * @retval SCI_SUCCESS This value is returned when the start task operation
337 * begins successfully.
340 SCI_STATUS scif_sas_domain_ready_start_task_handler(
341 SCI_BASE_DOMAIN_T * domain,
342 SCI_BASE_REMOTE_DEVICE_T * remote_device,
343 SCI_BASE_REQUEST_T * task_request
346 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T*) domain;
347 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
349 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*) task_request;
353 sci_base_object_get_logger(domain),
354 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_TASK_MANAGEMENT,
355 "scif_sas_domain_ready_start_task_handler(0x%x, 0x%x, 0x%x) enter\n",
356 domain, remote_device, task_request
359 status = fw_device->state_handlers->parent.start_task_handler(
360 &fw_device->parent, &fw_request->parent
363 if (status == SCI_SUCCESS)
365 // Add the task to the list of outstanding requests on the domain.
366 sci_fast_list_insert_tail(
367 &fw_domain->request_list, &fw_request->list_element
375 * @brief This method provides READY state specific handling for
376 * when a user attempts to complete a task request.
378 * @param[in] domain This parameter specifies the domain object
379 * on which the user is attempting to perform a complete task
381 * @param[in] remote_device This parameter specifies the remote device
382 * object on which the user is attempting to perform a start IO
384 * @param[in] task_request This parameter specifies the task request that
387 * @return This method returns an indication of whether the complete task
388 * operation succeeded.
389 * @retval SCI_SUCCESS This value is returned when the complete task operation
390 * begins successfully.
393 SCI_STATUS scif_sas_domain_ready_complete_task_handler(
394 SCI_BASE_DOMAIN_T * domain,
395 SCI_BASE_REMOTE_DEVICE_T * remote_device,
396 SCI_BASE_REQUEST_T * task_request
399 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
401 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*) task_request;
404 sci_base_object_get_logger(domain),
405 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_TASK_MANAGEMENT,
406 "scif_sas_domain_ready_complete_task_handler(0x%x, 0x%x, 0x%x) enter\n",
407 domain, remote_device, task_request
410 // Remove the IO from the list of outstanding requests on the domain.
411 sci_fast_list_remove_element(&fw_request->list_element);
413 return fw_device->state_handlers->parent.complete_task_handler(
414 &fw_device->parent, &fw_request->parent
420 * @brief This method provides READY state specific handling for when a user
421 * attempts to start a high priority IO request.
423 * @param[in] domain This parameter specifies the domain object
424 * on which the user is attempting to perform a start high priority
425 * IO operation (which is exclusively for Phy Control hard reset).
426 * @param[in] remote_device This parameter specifies the remote device
427 * object on which the user is attempting to perform a start
428 * high priority IO operation.
429 * @param[in] io_request This parameter specifies the io request that is
432 * @return This method returns an indication of whether the start IO
433 * operation succeeded.
434 * @retval SCI_SUCCESS This value is returned when the start IO operation
435 * begins successfully.
438 SCI_STATUS scif_sas_domain_ready_start_high_priority_io_handler(
439 SCI_BASE_DOMAIN_T * domain,
440 SCI_BASE_REMOTE_DEVICE_T * remote_device,
441 SCI_BASE_REQUEST_T * io_request
444 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T*) domain;
445 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
447 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*) io_request;
451 sci_base_object_get_logger(domain),
452 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
453 "scif_sas_domain_ready_start_high_priority_request_handler(0x%x, 0x%x, 0x%x) enter\n",
454 domain, remote_device, io_request
457 status = fw_device->state_handlers->start_high_priority_io_handler(
458 &fw_device->parent, &fw_request->parent
461 if (status == SCI_SUCCESS)
463 // Add the IO to the list of outstanding requests on the domain.
465 // When domain is in READY state, this high priority io is likely
466 // a smp Phy Control or Discover request sent to parent device of
467 // a target device, which is to be Target Reset. This high priority
468 // IO's probably has already been added to the domain's list as a
469 // SCIF_SAS_TASK_REQUEST. We need to check if it is already on the
472 if ( ! sci_fast_list_is_on_this_list(
473 &fw_domain->request_list, &fw_request->list_element))
475 sci_fast_list_insert_tail(
476 &fw_domain->request_list, &fw_request->list_element
485 * @brief This method provides READY state specific handling for
486 * when a user attempts to complete an high priroity IO request.
488 * @param[in] domain This parameter specifies the domain object
489 * on which the user is attempting to perform a complete high
490 * priority IO operation (which is exclusively for Phy Control
492 * @param[in] remote_device This parameter specifies the remote device
493 * object on which the user is attempting to perform a complete
495 * @param[in] io_request This parameter specifies the io request that is
498 * @return This method returns an indication of whether the complete IO
499 * operation succeeded.
500 * @retval SCI_SUCCESS This value is returned when the complete IO operation
504 SCI_STATUS scif_sas_domain_ready_complete_high_priority_io_handler(
505 SCI_BASE_DOMAIN_T * domain,
506 SCI_BASE_REMOTE_DEVICE_T * remote_device,
507 SCI_BASE_REQUEST_T * io_request,
508 void * response_data,
509 SCI_IO_STATUS completion_status
512 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
514 SCIF_SAS_REQUEST_T * fw_request= (SCIF_SAS_REQUEST_T*) io_request;
516 SCIC_TRANSPORT_PROTOCOL protocol;
519 sci_base_object_get_logger(domain),
520 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
521 "scif_sas_domain_ready_complete_high_priority_io_handler(0x%x, 0x%x, 0x%x, 0x%x) enter\n",
522 domain, remote_device, io_request, response_data
525 protocol = scic_io_request_get_protocol(fw_request->core_object);
527 // If the request is an SMP HARD/LINK RESET request, then the request
528 // came through the task management path (partially). As a result,
529 // the accounting for the request is managed in the task request
530 // completion path. Thus, only change the domain request counter if
531 // the request is not an SMP target reset of some sort.
533 (protocol != SCIC_SMP_PROTOCOL)
534 || (fw_device->protocol_device.smp_device.current_activity !=
535 SCIF_SAS_SMP_REMOTE_DEVICE_ACTIVITY_TARGET_RESET)
538 sci_fast_list_remove_element(&fw_request->list_element);
541 return fw_device->state_handlers->complete_high_priority_io_handler(
542 &fw_device->parent, &fw_request->parent, response_data, completion_status
546 //******************************************************************************
547 //* S T O P P I N G H A N D L E R S
548 //******************************************************************************
551 SCI_STATUS scif_sas_domain_stopping_device_stop_complete_handler(
552 SCI_BASE_DOMAIN_T * domain,
553 SCI_BASE_REMOTE_DEVICE_T * remote_device
556 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T *) domain;
559 sci_base_object_get_logger(domain),
560 SCIF_LOG_OBJECT_DOMAIN,
561 "scif_sas_domain_stopping_device_stop_complete_handler(0x%x, 0x%x) enter\n",
562 domain, remote_device
565 // Attempt to transition to the stopped state.
566 scif_sas_domain_transition_to_stopped_state(fw_domain);
572 * @brief This method provides STOPPING state specific handling for
573 * when a user attempts to complete an IO request.
575 * @param[in] domain This parameter specifies the domain object
576 * on which the user is attempting to perform a complete IO
578 * @param[in] remote_device This parameter specifies the remote device
579 * object on which the user is attempting to perform a complete
581 * @param[in] io_request This parameter specifies the io request that is
584 * @return This method returns an indication of whether the complete IO
585 * operation succeeded.
586 * @retval SCI_SUCCESS This value is returned when the complete IO operation
590 SCI_STATUS scif_sas_domain_stopping_complete_io_handler(
591 SCI_BASE_DOMAIN_T * domain,
592 SCI_BASE_REMOTE_DEVICE_T * remote_device,
593 SCI_BASE_REQUEST_T * io_request
596 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T *) domain;
600 sci_base_object_get_logger(domain),
601 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
602 "scif_sas_domain_stopping_complete_io_handler(0x%x, 0x%x, 0x%x) enter\n",
603 domain, remote_device, io_request
606 status = scif_sas_domain_ready_complete_io_handler(
607 domain, remote_device, io_request
610 // Attempt to transition to the stopped state.
611 scif_sas_domain_transition_to_stopped_state(fw_domain);
618 * @brief This method provides STOPPING state specific handling for
619 * when a user attempts to complete an IO request.
621 * @param[in] domain This parameter specifies the domain object
622 * on which the user is attempting to perform a complete IO
624 * @param[in] remote_device This parameter specifies the remote device
625 * object on which the user is attempting to perform a complete
627 * @param[in] io_request This parameter specifies the io request that is
630 * @return This method returns an indication of whether the complete IO
631 * operation succeeded.
632 * @retval SCI_SUCCESS This value is returned when the complete IO operation
636 SCI_STATUS scif_sas_domain_stopping_complete_high_priority_io_handler(
637 SCI_BASE_DOMAIN_T * domain,
638 SCI_BASE_REMOTE_DEVICE_T * remote_device,
639 SCI_BASE_REQUEST_T * io_request,
640 void * response_data,
641 SCI_IO_STATUS completion_status
644 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T *) domain;
648 sci_base_object_get_logger(domain),
649 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
650 "scif_sas_domain_stopping_complete_io_handler(0x%x, 0x%x, 0x%x) enter\n",
651 domain, remote_device, io_request
654 status = scif_sas_domain_ready_complete_high_priority_io_handler(
655 domain, remote_device, io_request, response_data, completion_status
658 // Attempt to transition to the stopped state.
659 scif_sas_domain_transition_to_stopped_state(fw_domain);
666 * @brief This method provides STOPPING state specific handling for
667 * when a user attempts to complete a task request.
669 * @param[in] domain This parameter specifies the domain object
670 * on which the user is attempting to perform a complete task
673 * @return This method returns an indication of whether the complete task
674 * operation succeeded.
675 * @retval SCI_SUCCESS This value is returned when the complete task operation
676 * begins successfully.
679 SCI_STATUS scif_sas_domain_stopping_complete_task_handler(
680 SCI_BASE_DOMAIN_T * domain,
681 SCI_BASE_REMOTE_DEVICE_T * remote_device,
682 SCI_BASE_REQUEST_T * task_request
685 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T *) domain;
689 sci_base_object_get_logger(domain),
690 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_TASK_MANAGEMENT,
691 "scif_sas_domain_stopping_complete_task_handler(0x%x, 0x%x, 0x%x) enter\n",
692 domain, remote_device, task_request
695 status = scif_sas_domain_ready_complete_task_handler(
696 domain, remote_device, task_request
699 // Attempt to transition to the stopped state.
700 scif_sas_domain_transition_to_stopped_state(fw_domain);
705 //******************************************************************************
706 //* D I S C O V E R I N G H A N D L E R S
707 //******************************************************************************
710 * @brief This method provides DISCOVERING state specific processing for
711 * reception of a port NOT ready notification from the core. A port
712 * NOT ready notification forces the discovery operation to complete
713 * in error. Additionally, all IOs are aborted and devices removed.
715 * @param[in] domain This parameter specifies the domain object
716 * for which the core port is no longer ready.
721 SCI_STATUS scif_sas_domain_discovering_port_not_ready_handler(
722 SCI_BASE_DOMAIN_T * domain,
727 sci_base_object_get_logger(domain),
728 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY,
729 "scif_sas_domain_discovering_port_not_ready_handler(0x%x, 0x%x) enter\n",
734 // Change to the STOPPING state to cause existing request
735 // completions to be terminated and devices removed.
736 sci_base_state_machine_change_state(
737 &domain->state_machine, SCI_BASE_DOMAIN_STATE_STOPPING
744 SCI_STATUS scif_sas_domain_discovering_device_start_complete_handler(
745 SCI_BASE_DOMAIN_T * domain,
746 SCI_BASE_REMOTE_DEVICE_T * remote_device
749 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T *)domain;
752 sci_base_object_get_logger(domain),
753 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY,
754 "scif_sas_domain_discovering_device_start_complete_handler(0x%x) enter\n",
755 domain, remote_device
758 //domain will decide what's next step.
759 scif_sas_domain_continue_discover(fw_domain);
764 // ---------------------------------------------------------------------------
767 SCI_STATUS scif_sas_domain_discovering_device_stop_complete_handler(
768 SCI_BASE_DOMAIN_T * domain,
769 SCI_BASE_REMOTE_DEVICE_T * remote_device
773 sci_base_object_get_logger(domain),
774 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY,
775 "scif_sas_domain_discovering_device_stop_complete_handler(0x%x) enter\n",
776 domain, remote_device
784 * @brief This method provides DISCOVERING state specific handling for when a user
785 * attempts to start a high priority IO request.
787 * @param[in] domain This parameter specifies the domain object
788 * on which the user is attempting to perform a start IO
790 * @param[in] remote_device This parameter specifies the remote device
791 * object on which the user is attempting to perform a start IO
793 * @param[in] io_request This parameter specifies the io request that is
796 * @return This method returns an indication of whether the start IO
797 * operation succeeded.
798 * @retval SCI_SUCCESS This value is returned when the start IO operation
799 * begins successfully.
802 SCI_STATUS scif_sas_domain_discovering_start_high_priority_io_handler(
803 SCI_BASE_DOMAIN_T * domain,
804 SCI_BASE_REMOTE_DEVICE_T * remote_device,
805 SCI_BASE_REQUEST_T * io_request
808 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T*) domain;
809 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
811 SCIF_SAS_REQUEST_T * fw_request = (SCIF_SAS_REQUEST_T*) io_request;
815 sci_base_object_get_logger(domain),
816 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
817 "scif_sas_domain_discovery_start_high_priority_request_handler(0x%x, 0x%x, 0x%x) enter\n",
818 domain, remote_device, io_request
821 status = fw_device->state_handlers->start_high_priority_io_handler(
822 &fw_device->parent, &fw_request->parent
825 if (status == SCI_SUCCESS)
827 // Add the IO to the list of outstanding requests on the domain.
829 // It is possible this high priority IO's has already been added to
830 // the domain's list as a SCIF_SAS_TASK_REQUEST. We need to check
831 // if it is already on the list.
832 if ( ! sci_fast_list_is_on_this_list(
833 &fw_domain->request_list, &fw_request->list_element))
835 sci_fast_list_insert_tail(
836 &fw_domain->request_list, &fw_request->list_element
845 * @brief This method provides DISCOVERING state specific handling for
846 * when a user attempts to complete an IO request. User IOs are
847 * allowed to be completed during discovery.
849 * @param[in] domain This parameter specifies the domain object
850 * on which the user is attempting to perform a complete IO
852 * @param[in] remote_device This parameter specifies the remote device
853 * object on which the user is attempting to perform a complete
855 * @param[in] io_request This parameter specifies the io request that is
858 * @return This method returns an indication of whether the complete IO
859 * operation succeeded.
860 * @retval SCI_SUCCESS This value is returned when the complete IO operation
864 SCI_STATUS scif_sas_domain_discovering_complete_io_handler(
865 SCI_BASE_DOMAIN_T * domain,
866 SCI_BASE_REMOTE_DEVICE_T * remote_device,
867 SCI_BASE_REQUEST_T * io_request
871 sci_base_object_get_logger(domain),
872 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
873 "scif_sas_domain_discovering_complete_io_handler(0x%x, 0x%x, 0x%x) enter\n",
874 domain, remote_device, io_request
877 return scif_sas_domain_ready_complete_io_handler(
878 domain, remote_device, io_request
883 * @brief This method provides DISCOVERING state specific handling for
884 * when a user attempts to complete an high priroity IO request. User
885 * IOs are allowed to be completed during discovery.
887 * @param[in] domain This parameter specifies the domain object
888 * on which the user is attempting to perform a complete IO
890 * @param[in] remote_device This parameter specifies the remote device
891 * object on which the user is attempting to perform a complete
893 * @param[in] io_request This parameter specifies the io request that is
896 * @return This method returns an indication of whether the complete IO
897 * operation succeeded.
898 * @retval SCI_SUCCESS This value is returned when the complete IO operation
902 SCI_STATUS scif_sas_domain_discovering_complete_high_priority_io_handler(
903 SCI_BASE_DOMAIN_T * domain,
904 SCI_BASE_REMOTE_DEVICE_T * remote_device,
905 SCI_BASE_REQUEST_T * io_request,
906 void * response_data,
907 SCI_IO_STATUS completion_status
910 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
912 SCIF_SAS_REQUEST_T * fw_request= (SCIF_SAS_REQUEST_T*) io_request;
914 SCIC_TRANSPORT_PROTOCOL protocol;
917 sci_base_object_get_logger(domain),
918 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
919 "scif_sas_domain_discovering_complete_high_priority_io_handler(0x%x, 0x%x, 0x%x, 0x%x) enter\n",
920 domain, remote_device, io_request, response_data
923 protocol = scic_io_request_get_protocol(fw_request->core_object);
925 // Remove the IO from the list of outstanding requests on the domain.
927 // If the request is an SMP HARD/LINK RESET request, then the request
928 // came through the task management path (partially). As a result,
929 // the accounting for the request is managed in the task request
930 // completion path. Thus, only change the domain request counter if
931 // the request is not an SMP target reset of some sort.
933 (protocol != SCIC_SMP_PROTOCOL)
934 || (fw_device->protocol_device.smp_device.current_activity !=
935 SCIF_SAS_SMP_REMOTE_DEVICE_ACTIVITY_TARGET_RESET)
938 sci_fast_list_remove_element(&fw_request->list_element);
941 return fw_device->state_handlers->complete_high_priority_io_handler(
942 &fw_device->parent, &fw_request->parent, response_data, completion_status
948 * @brief This method provides DISCOVERING state specific handling for
949 * when the framework attempts to complete an IO request. Internal
950 * Framework IOs allowed to be continued during discovery.
952 * @param[in] domain This parameter specifies the domain object
953 * on which the user is attempting to perform a continue IO
955 * @param[in] remote_device This parameter specifies the remote device
956 * object on which the user is attempting to perform a continue
958 * @param[in] io_request This parameter specifies the io request that is
961 * @return This method returns an indication of whether the continue IO
962 * operation succeeded.
963 * @retval SCI_SUCCESS This value is returned when the continue IO operation
967 SCI_STATUS scif_sas_domain_discovering_continue_io_handler(
968 SCI_BASE_DOMAIN_T * domain,
969 SCI_BASE_REMOTE_DEVICE_T * remote_device,
970 SCI_BASE_REQUEST_T * io_request
974 sci_base_object_get_logger(domain),
975 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_IO_REQUEST,
976 "scif_sas_domain_discovering_continue_io_handler(0x%x, 0x%x, 0x%x) enter\n",
977 domain, remote_device, io_request
980 /// @todo fix return code handling.
986 * @brief This method provides handling when a user attempts to start
987 * a task on a domain in DISCOVER state, only hard reset is allowed.
989 * @param[in] domain This parameter specifies the domain object
990 * on which the user is attempting to perform a start task
992 * @param[in] remote_device This parameter specifies the remote device
993 * object on which the user is attempting to perform a start IO
995 * @param[in] task_request This parameter specifies the task request that
998 * @return This method returns a status of start task operations
999 * @retval SCI_FAILURE_INVALID_STATE This value is returned for any tasks,
1000 * except for HARD RESET.
1003 SCI_STATUS scif_sas_domain_discovering_start_task_handler(
1004 SCI_BASE_DOMAIN_T * domain,
1005 SCI_BASE_REMOTE_DEVICE_T * remote_device,
1006 SCI_BASE_REQUEST_T * task_request
1009 SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*)
1011 SCIF_SAS_TASK_REQUEST_T * fw_task = (SCIF_SAS_TASK_REQUEST_T*)task_request;
1013 //Only let target reset go through.
1014 if (scif_sas_task_request_get_function(fw_task)
1015 == SCI_SAS_HARD_RESET)
1017 //If the domain is in the middle of smp DISCOVER process,
1018 //interrupt it. After target reset is done, resume the smp DISCOVERY.
1019 scif_sas_domain_cancel_smp_activities(fw_device->domain);
1021 return scif_sas_domain_ready_start_task_handler(domain, remote_device, task_request);
1025 sci_base_object_get_logger(domain),
1026 SCIF_LOG_OBJECT_DOMAIN,
1027 "Domain:0x%x Device:0x%x State:0x%x start task message invalid\n",
1028 domain, remote_device,
1029 sci_base_state_machine_get_state(&domain->state_machine)
1032 return SCI_FAILURE_INVALID_STATE;
1038 * @brief This method provides DISCOVERING state specific handling for
1039 * when a user attempts to complete a task request. User task
1040 * management requests are allowed to be completed during discovery.
1042 * @param[in] domain This parameter specifies the domain object
1043 * on which the user is attempting to perform a complete IO
1045 * @param[in] remote_device This parameter specifies the remote device
1046 * object on which the user is attempting to perform a complete
1048 * @param[in] task_request This parameter specifies the task request that
1049 * is being completed.
1051 * @return This method returns an indication of whether the complete task
1052 * management operation succeeded.
1053 * @retval SCI_SUCCESS This value is returned when the complete task request
1057 SCI_STATUS scif_sas_domain_discovering_complete_task_handler(
1058 SCI_BASE_DOMAIN_T * domain,
1059 SCI_BASE_REMOTE_DEVICE_T * remote_device,
1060 SCI_BASE_REQUEST_T * task_request
1066 sci_base_object_get_logger(domain),
1067 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_TASK_MANAGEMENT,
1068 "scif_sas_domain_discovering_complete_task_handler(0x%x, 0x%x, 0x%x) enter\n",
1069 domain, remote_device, task_request
1072 status = scif_sas_domain_ready_complete_task_handler(
1073 domain, remote_device, task_request
1079 //******************************************************************************
1080 //* D E F A U L T H A N D L E R S
1081 //******************************************************************************
1084 * @brief This method provides default handling (i.e. returns an error)
1085 * when a user attempts to discover a domain and a discovery
1086 * operation is not allowed.
1088 * @param[in] domain This parameter specifies the domain object
1089 * on which the user is attempting to perform an discover
1091 * @param[in] op_timeout This parameter specifies the timeout
1092 * (in milliseconds) for the entire discovery operation.
1093 * This timeout value should be some multiple of the
1094 * individual device_timeout value.
1095 * @param[in] device_timeout This parameter specifies the timeout
1096 * (in milliseconds) for an individual device being discovered
1097 * and configured during this operation.
1099 * @return This method returns an indication that discovery operations
1101 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1104 SCI_STATUS scif_sas_domain_default_discover_handler(
1105 SCI_BASE_DOMAIN_T * domain,
1111 sci_base_object_get_logger((SCIF_SAS_DOMAIN_T *)domain),
1112 SCIF_LOG_OBJECT_DOMAIN | SCIF_LOG_OBJECT_DOMAIN_DISCOVERY,
1113 "Domain:0x%x State:0x%x requested to discover in invalid state\n",
1115 sci_base_state_machine_get_state(&domain->state_machine)
1118 return SCI_FAILURE_INVALID_STATE;
1122 * @brief This method provides default processing for reception of a port
1123 * ready notification from the core.
1125 * @param[in] domain This parameter specifies the domain object
1126 * on which the core port has just come ready.
1131 SCI_STATUS scif_sas_domain_default_port_ready_handler(
1132 SCI_BASE_DOMAIN_T * domain
1136 sci_base_object_get_logger(domain),
1137 SCIF_LOG_OBJECT_DOMAIN,
1138 "Domain:0x%x State:0x%x port now ready\n",
1140 sci_base_state_machine_get_state(&domain->state_machine)
1147 * @brief This method provides default processing for reception of a port
1148 * NOT ready notification from the core.
1150 * @param[in] domain This parameter specifies the domain object
1151 * on which the core port has just come ready.
1156 SCI_STATUS scif_sas_domain_default_port_not_ready_handler(
1157 SCI_BASE_DOMAIN_T * domain,
1162 sci_base_object_get_logger(domain),
1163 SCIF_LOG_OBJECT_DOMAIN,
1164 "Domain:0x%x State:0x%x Port Not Ready 0x%x in invalid state\n",
1166 sci_base_state_machine_get_state(&domain->state_machine),
1170 return SCI_FAILURE_INVALID_STATE;
1174 * @brief This method provides default handling (i.e. returns an error)
1175 * when a user attempts to start an IO on a domain and a start
1176 * IO operation is not allowed.
1178 * @param[in] domain This parameter specifies the domain object
1179 * on which the user is attempting to perform a start IO
1181 * @param[in] remote_device This parameter specifies the remote device
1182 * object on which the user is attempting to perform a start IO
1184 * @param[in] io_request This parameter specifies the io request that is
1187 * @return This method returns an indication that start IO operations
1189 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1192 SCI_STATUS scif_sas_domain_default_start_io_handler(
1193 SCI_BASE_DOMAIN_T * domain,
1194 SCI_BASE_REMOTE_DEVICE_T * remote_device,
1195 SCI_BASE_REQUEST_T * io_request
1199 sci_base_object_get_logger(domain),
1200 SCIF_LOG_OBJECT_DOMAIN,
1201 "Domain:0x%x Device:0x%x State:0x%x start IO message invalid\n",
1202 domain, remote_device,
1203 sci_base_state_machine_get_state(&domain->state_machine)
1206 return SCI_FAILURE_INVALID_STATE;
1210 * @brief This method provides default handling (i.e. returns an error)
1211 * when a user attempts to complete an IO on a domain and a
1212 * complete IO operation is not allowed.
1214 * @param[in] domain This parameter specifies the domain object
1215 * on which the user is attempting to perform a complete IO
1217 * @param[in] remote_device This parameter specifies the remote device
1218 * object on which the user is attempting to perform a complete IO
1220 * @param[in] io_request This parameter specifies the io request that is
1223 * @return This method returns an indication that complete IO operations
1225 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1228 SCI_STATUS scif_sas_domain_default_complete_io_handler(
1229 SCI_BASE_DOMAIN_T * domain,
1230 SCI_BASE_REMOTE_DEVICE_T * remote_device,
1231 SCI_BASE_REQUEST_T * io_request
1235 sci_base_object_get_logger(domain),
1236 SCIF_LOG_OBJECT_DOMAIN,
1237 "Domain:0x%x Device:0x%x State:0x%x complete IO message invalid\n",
1238 domain, remote_device,
1239 sci_base_state_machine_get_state(&domain->state_machine)
1242 return SCI_FAILURE_INVALID_STATE;
1247 * @brief This method provides default handling (i.e. returns an error)
1248 * when a user attempts to complete an IO on a domain and a
1249 * complete IO operation is not allowed.
1251 * @param[in] domain This parameter specifies the domain object
1252 * on which the user is attempting to perform a complete IO
1254 * @param[in] remote_device This parameter specifies the remote device
1255 * object on which the user is attempting to perform a complete IO
1257 * @param[in] io_request This parameter specifies the io request that is
1260 * @return This method returns an indication that complete IO operations
1262 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1265 SCI_STATUS scif_sas_domain_default_complete_high_priority_io_handler(
1266 SCI_BASE_DOMAIN_T * domain,
1267 SCI_BASE_REMOTE_DEVICE_T * remote_device,
1268 SCI_BASE_REQUEST_T * io_request,
1269 void * response_data,
1270 SCI_IO_STATUS completion_status
1274 sci_base_object_get_logger(domain),
1275 SCIF_LOG_OBJECT_DOMAIN,
1276 "Domain:0x%x Device:0x%x State:0x%x complete IO message invalid\n",
1277 domain, remote_device,
1278 sci_base_state_machine_get_state(&domain->state_machine)
1281 return SCI_FAILURE_INVALID_STATE;
1285 * @brief This method provides default handling (i.e. returns an error)
1286 * when a user attempts to continue an IO on a domain and a
1287 * continue IO operation is not allowed.
1289 * @param[in] domain This parameter specifies the domain object
1290 * on which the user is attempting to perform a continue IO
1292 * @param[in] remote_device This parameter specifies the remote device
1293 * object on which the user is attempting to perform a start IO
1295 * @param[in] io_request This parameter specifies the io request that is
1298 * @return This method returns an indication that continue IO operations
1300 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1303 SCI_STATUS scif_sas_domain_default_continue_io_handler(
1304 SCI_BASE_DOMAIN_T * domain,
1305 SCI_BASE_REMOTE_DEVICE_T * remote_device,
1306 SCI_BASE_REQUEST_T * io_request
1310 sci_base_object_get_logger(domain),
1311 SCIF_LOG_OBJECT_DOMAIN,
1312 "Domain:0x%x Device:0x%x State:0x%x contineu IO message invalid\n",
1313 domain, remote_device,
1314 sci_base_state_machine_get_state(&domain->state_machine)
1317 return SCI_FAILURE_INVALID_STATE;
1321 * @brief This method provides default handling (i.e. returns an error)
1322 * when a user attempts to start a task on a domain and a start
1323 * task operation is not allowed.
1325 * @param[in] domain This parameter specifies the domain object
1326 * on which the user is attempting to perform a start task
1328 * @param[in] remote_device This parameter specifies the remote device
1329 * object on which the user is attempting to perform a start IO
1331 * @param[in] task_request This parameter specifies the task request that
1334 * @return This method returns an indication that start task operations
1336 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1339 SCI_STATUS scif_sas_domain_default_start_task_handler(
1340 SCI_BASE_DOMAIN_T * domain,
1341 SCI_BASE_REMOTE_DEVICE_T * remote_device,
1342 SCI_BASE_REQUEST_T * task_request
1346 sci_base_object_get_logger(domain),
1347 SCIF_LOG_OBJECT_DOMAIN,
1348 "Domain:0x%x Device:0x%x State:0x%x start task message invalid\n",
1349 domain, remote_device,
1350 sci_base_state_machine_get_state(&domain->state_machine)
1353 return SCI_FAILURE_INVALID_STATE;
1357 * @brief This method provides default handling (i.e. returns an error)
1358 * when a user attempts to complete a task on a domain and a
1359 * complete task operation is not allowed.
1361 * @param[in] domain This parameter specifies the domain object
1362 * on which the user is attempting to perform a complete task
1364 * @param[in] remote_device This parameter specifies the remote device
1365 * object on which the user is attempting to perform a start IO
1367 * @param[in] task_request This parameter specifies the task request that
1370 * @return This method returns an indication that complete task operations
1372 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1375 SCI_STATUS scif_sas_domain_default_complete_task_handler(
1376 SCI_BASE_DOMAIN_T * domain,
1377 SCI_BASE_REMOTE_DEVICE_T * remote_device,
1378 SCI_BASE_REQUEST_T * task_request
1382 sci_base_object_get_logger(domain),
1383 SCIF_LOG_OBJECT_DOMAIN,
1384 "Domain:0x%x Device:0x%x State:0x%x complete task message invalid\n",
1385 domain, remote_device,
1386 sci_base_state_machine_get_state(&domain->state_machine)
1389 return SCI_FAILURE_INVALID_STATE;
1393 * @brief This method provides default handling (i.e. returns an error)
1394 * when a remote device start operation completes in a state.
1396 * @param[in] domain This parameter specifies the domain object
1397 * on which the remote device start operation is completing.
1398 * @param[in] remote_device This parameter specifies the remote device
1399 * for which the start operation is completing.
1401 * @return This method returns an indication that start operation
1402 * completion is not allowed.
1403 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1406 SCI_STATUS scif_sas_domain_default_device_start_complete_handler(
1407 SCI_BASE_DOMAIN_T * domain,
1408 SCI_BASE_REMOTE_DEVICE_T * remote_device
1412 sci_base_object_get_logger(domain),
1413 SCIF_LOG_OBJECT_DOMAIN,
1414 "Domain:0x%x Device:0x%x State:0x%x device stop complete message invalid\n",
1415 domain, remote_device,
1416 sci_base_state_machine_get_state(&domain->state_machine)
1419 return SCI_FAILURE_INVALID_STATE;
1423 * @brief This method provides default handling (i.e. returns an error)
1424 * when a remote device stop operation completes in a state.
1426 * @param[in] domain This parameter specifies the domain object
1427 * on which the remote device stop operation is completing.
1428 * @param[in] remote_device This parameter specifies the remote device
1429 * for which the stop operation is completing.
1431 * @return This method returns an indication that stop operation
1432 * completion is not allowed.
1433 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1436 SCI_STATUS scif_sas_domain_default_device_stop_complete_handler(
1437 SCI_BASE_DOMAIN_T * domain,
1438 SCI_BASE_REMOTE_DEVICE_T * remote_device
1442 sci_base_object_get_logger(domain),
1443 SCIF_LOG_OBJECT_DOMAIN,
1444 "Domain:0x%x Device:0x%x State:0x%x device stop complete message invalid\n",
1445 domain, remote_device,
1446 sci_base_state_machine_get_state(&domain->state_machine)
1449 return SCI_FAILURE_INVALID_STATE;
1453 * @brief This method provides default handling (i.e. returns an error)
1454 * when sci user try to destruct a remote device of this domain.
1456 * @param[in] domain This parameter specifies the domain object
1457 * on which the remote device is to be destructed.
1458 * @param[in] remote_device This parameter specifies the remote device
1461 * @return This method returns an indication that device destruction
1463 * @retval SCI_FAILURE_INVALID_STATE This value is always returned.
1466 SCI_STATUS scif_sas_domain_default_device_destruct_handler(
1467 SCI_BASE_DOMAIN_T * domain,
1468 SCI_BASE_REMOTE_DEVICE_T * remote_device
1472 sci_base_object_get_logger(domain),
1473 SCIF_LOG_OBJECT_DOMAIN,
1474 "Domain:0x%x Device:0x%x State:0x%x device destruct in invalid state\n",
1475 domain, remote_device,
1476 sci_base_state_machine_get_state(&domain->state_machine)
1479 return SCI_FAILURE_INVALID_STATE;
1484 * @brief This method provides handling when sci user destruct a remote
1485 * device of this domain in discovering state. Mainly the device
1486 * is removed from domain's remote_device_list.
1488 * @param[in] domain This parameter specifies the domain object
1489 * on which the remote device is to be destructed.
1490 * @param[in] remote_device This parameter specifies the remote device
1493 * @return This method returns a status of the device destruction.
1494 * @retval SCI_SUCCESS This value is returned when a remote device is
1495 * successfully removed from domain.
1498 SCI_STATUS scif_sas_domain_discovering_device_destruct_handler(
1499 SCI_BASE_DOMAIN_T * domain,
1500 SCI_BASE_REMOTE_DEVICE_T * remote_device
1503 SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T *)domain;
1506 sci_base_object_get_logger(domain),
1507 SCIF_LOG_OBJECT_DOMAIN,
1508 "Domain:0x%x Device:0x%x State:0x%x device destruct in domain DISCOVERING state\n",
1509 domain, remote_device,
1510 sci_base_state_machine_get_state(&domain->state_machine)
1513 //remove the remote device from domain's remote_device_list
1514 sci_abstract_list_erase(
1515 &(fw_domain->remote_device_list),
1523 #define scif_sas_domain_stopped_discover_handler \
1524 scif_sas_domain_ready_discover_handler
1526 #define scif_sas_domain_default_start_high_priority_io_handler \
1527 scif_sas_domain_default_start_io_handler
1530 SCI_BASE_DOMAIN_STATE_HANDLER_T
1531 scif_sas_domain_state_handler_table[SCI_BASE_DOMAIN_MAX_STATES] =
1533 // SCI_BASE_DOMAIN_STATE_INITIAL
1535 scif_sas_domain_default_discover_handler,
1536 scif_sas_domain_default_port_ready_handler,
1537 scif_sas_domain_default_port_not_ready_handler,
1538 scif_sas_domain_default_device_start_complete_handler,
1539 scif_sas_domain_default_device_stop_complete_handler,
1540 scif_sas_domain_default_device_destruct_handler,
1541 scif_sas_domain_default_start_io_handler,
1542 scif_sas_domain_default_start_high_priority_io_handler,
1543 scif_sas_domain_default_complete_io_handler,
1544 scif_sas_domain_default_complete_high_priority_io_handler,
1545 scif_sas_domain_default_continue_io_handler,
1546 scif_sas_domain_default_start_task_handler,
1547 scif_sas_domain_default_complete_task_handler
1549 // SCI_BASE_DOMAIN_STATE_STARTING
1551 scif_sas_domain_default_discover_handler,
1552 scif_sas_domain_starting_port_ready_handler,
1553 scif_sas_domain_default_port_not_ready_handler,
1554 scif_sas_domain_default_device_start_complete_handler,
1555 scif_sas_domain_default_device_stop_complete_handler,
1556 scif_sas_domain_default_device_destruct_handler,
1557 scif_sas_domain_default_start_io_handler,
1558 scif_sas_domain_default_start_high_priority_io_handler,
1559 scif_sas_domain_default_complete_io_handler,
1560 scif_sas_domain_default_complete_high_priority_io_handler,
1561 scif_sas_domain_default_continue_io_handler,
1562 scif_sas_domain_default_start_task_handler,
1563 scif_sas_domain_default_complete_task_handler
1565 // SCI_BASE_DOMAIN_STATE_READY
1567 scif_sas_domain_ready_discover_handler,
1568 scif_sas_domain_default_port_ready_handler,
1569 scif_sas_domain_ready_port_not_ready_handler,
1570 scif_sas_domain_default_device_start_complete_handler,
1571 scif_sas_domain_default_device_stop_complete_handler,
1572 scif_sas_domain_default_device_destruct_handler,
1573 scif_sas_domain_ready_start_io_handler,
1574 scif_sas_domain_ready_start_high_priority_io_handler,
1575 scif_sas_domain_ready_complete_io_handler,
1576 scif_sas_domain_ready_complete_high_priority_io_handler,
1577 scif_sas_domain_ready_continue_io_handler,
1578 scif_sas_domain_ready_start_task_handler,
1579 scif_sas_domain_ready_complete_task_handler
1581 // SCI_BASE_DOMAIN_STATE_STOPPING
1583 scif_sas_domain_default_discover_handler,
1584 scif_sas_domain_default_port_ready_handler,
1585 scif_sas_domain_default_port_not_ready_handler,
1586 scif_sas_domain_default_device_start_complete_handler,
1587 scif_sas_domain_stopping_device_stop_complete_handler,
1588 scif_sas_domain_default_device_destruct_handler,
1589 scif_sas_domain_default_start_io_handler,
1590 scif_sas_domain_default_start_high_priority_io_handler,
1591 scif_sas_domain_stopping_complete_io_handler,
1592 scif_sas_domain_stopping_complete_high_priority_io_handler,
1593 scif_sas_domain_default_continue_io_handler,
1594 scif_sas_domain_default_start_task_handler,
1595 scif_sas_domain_stopping_complete_task_handler
1597 // SCI_BASE_DOMAIN_STATE_STOPPED
1599 scif_sas_domain_stopped_discover_handler,
1600 scif_sas_domain_default_port_ready_handler,
1601 scif_sas_domain_default_port_not_ready_handler,
1602 scif_sas_domain_default_device_start_complete_handler,
1603 scif_sas_domain_default_device_stop_complete_handler,
1604 scif_sas_domain_default_device_destruct_handler,
1605 scif_sas_domain_default_start_io_handler,
1606 scif_sas_domain_default_start_high_priority_io_handler,
1607 scif_sas_domain_default_complete_io_handler,
1608 scif_sas_domain_default_complete_high_priority_io_handler,
1609 scif_sas_domain_default_continue_io_handler,
1610 scif_sas_domain_default_start_task_handler,
1611 scif_sas_domain_default_complete_task_handler
1613 // SCI_BASE_DOMAIN_STATE_DISCOVERING
1615 scif_sas_domain_default_discover_handler,
1616 scif_sas_domain_default_port_ready_handler,
1617 scif_sas_domain_discovering_port_not_ready_handler,
1618 scif_sas_domain_discovering_device_start_complete_handler,
1619 scif_sas_domain_discovering_device_stop_complete_handler,
1620 scif_sas_domain_discovering_device_destruct_handler, //
1621 scif_sas_domain_default_start_io_handler,
1622 scif_sas_domain_discovering_start_high_priority_io_handler,
1623 scif_sas_domain_discovering_complete_io_handler,
1624 scif_sas_domain_discovering_complete_high_priority_io_handler, //
1625 scif_sas_domain_discovering_continue_io_handler,
1626 scif_sas_domain_discovering_start_task_handler,
1627 scif_sas_domain_discovering_complete_task_handler