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
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 * This file contains the implementation of remote device methods.
62 #include "intel_sas.h"
64 #include "sci_environment.h"
65 #include "scic_port.h"
67 #include "scic_remote_device.h"
68 #include "scic_sds_port.h"
69 #include "scic_sds_phy.h"
70 #include "scic_sds_remote_device.h"
71 #include "scic_sds_request.h"
72 #include "scic_sds_controller.h"
74 #define SCIC_SDS_REMOTE_DEVICE_RESET_TIMEOUT (1000)
77 * *****************************************************************************
78 * * CORE REMOTE DEVICE PRIVATE METHODS
79 * ***************************************************************************** */
82 * *****************************************************************************
83 * * CORE REMOTE DEVICE PUBLIC METHODS
84 * ***************************************************************************** */
86 u32 scic_remote_device_get_object_size(void)
88 return sizeof(struct scic_sds_remote_device)
89 + sizeof(struct scic_sds_remote_node_context);
92 /* --------------------------------------------------------------------------- */
94 void scic_remote_device_construct(struct scic_sds_port *sci_port,
95 struct scic_sds_remote_device *sci_dev)
97 sci_dev->owning_port = sci_port;
98 sci_dev->started_request_count = 0;
99 sci_dev->rnc = (struct scic_sds_remote_node_context *) &sci_dev[1];
101 sci_base_remote_device_construct(
103 scic_sds_remote_device_state_table
106 scic_sds_remote_node_context_construct(
109 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX
112 sci_object_set_association(sci_dev->rnc, sci_dev);
116 enum sci_status scic_remote_device_da_construct(
117 struct scic_sds_remote_device *sci_dev)
119 enum sci_status status;
120 u16 remote_node_index;
121 struct sci_sas_identify_address_frame_protocols protocols;
124 * This information is request to determine how many remote node context
125 * entries will be needed to store the remote node.
127 scic_sds_port_get_attached_protocols(sci_dev->owning_port, &protocols);
128 sci_dev->target_protocols.u.all = protocols.u.all;
129 sci_dev->is_direct_attached = true;
130 #if !defined(DISABLE_ATAPI)
131 sci_dev->is_atapi = scic_sds_remote_device_is_atapi(sci_dev);
134 status = scic_sds_controller_allocate_remote_node_context(
135 sci_dev->owning_port->owning_controller,
139 if (status == SCI_SUCCESS) {
140 scic_sds_remote_node_context_set_remote_node_index(
141 sci_dev->rnc, remote_node_index);
143 scic_sds_port_get_attached_sas_address(
144 sci_dev->owning_port, &sci_dev->device_address);
146 if (sci_dev->target_protocols.u.bits.attached_ssp_target) {
147 sci_dev->has_ready_substate_machine = false;
148 } else if (sci_dev->target_protocols.u.bits.attached_stp_target) {
149 sci_dev->has_ready_substate_machine = true;
151 sci_base_state_machine_construct(
152 &sci_dev->ready_substate_machine,
153 &sci_dev->parent.parent,
154 scic_sds_stp_remote_device_ready_substate_table,
155 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
156 } else if (sci_dev->target_protocols.u.bits.attached_smp_target) {
157 sci_dev->has_ready_substate_machine = true;
159 /* add the SMP ready substate machine construction here */
160 sci_base_state_machine_construct(
161 &sci_dev->ready_substate_machine,
162 &sci_dev->parent.parent,
163 scic_sds_smp_remote_device_ready_substate_table,
164 SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
167 sci_dev->connection_rate = scic_sds_port_get_max_allowed_speed(
168 sci_dev->owning_port);
170 /* / @todo Should I assign the port width by reading all of the phys on the port? */
171 sci_dev->device_port_width = 1;
178 static void scic_sds_remote_device_get_info_from_smp_discover_response(
179 struct scic_sds_remote_device *this_device,
180 struct smp_response_discover *discover_response)
182 /* decode discover_response to set sas_address to this_device. */
183 this_device->device_address.high =
184 discover_response->attached_sas_address.high;
186 this_device->device_address.low =
187 discover_response->attached_sas_address.low;
189 this_device->target_protocols.u.all = discover_response->protocols.u.all;
193 enum sci_status scic_remote_device_ea_construct(
194 struct scic_sds_remote_device *sci_dev,
195 struct smp_response_discover *discover_response)
197 enum sci_status status;
198 struct scic_sds_controller *the_controller;
200 the_controller = scic_sds_port_get_controller(sci_dev->owning_port);
202 scic_sds_remote_device_get_info_from_smp_discover_response(
203 sci_dev, discover_response);
205 status = scic_sds_controller_allocate_remote_node_context(
206 the_controller, sci_dev, &sci_dev->rnc->remote_node_index);
208 if (status == SCI_SUCCESS) {
209 if (sci_dev->target_protocols.u.bits.attached_ssp_target) {
210 sci_dev->has_ready_substate_machine = false;
211 } else if (sci_dev->target_protocols.u.bits.attached_smp_target) {
212 sci_dev->has_ready_substate_machine = true;
214 /* add the SMP ready substate machine construction here */
215 sci_base_state_machine_construct(
216 &sci_dev->ready_substate_machine,
217 &sci_dev->parent.parent,
218 scic_sds_smp_remote_device_ready_substate_table,
219 SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
220 } else if (sci_dev->target_protocols.u.bits.attached_stp_target) {
221 sci_dev->has_ready_substate_machine = true;
223 sci_base_state_machine_construct(
224 &sci_dev->ready_substate_machine,
225 &sci_dev->parent.parent,
226 scic_sds_stp_remote_device_ready_substate_table,
227 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
231 * For SAS-2 the physical link rate is actually a logical link
232 * rate that incorporates multiplexing. The SCU doesn't
233 * incorporate multiplexing and for the purposes of the
234 * connection the logical link rate is that same as the
235 * physical. Furthermore, the SAS-2 and SAS-1.1 fields overlay
236 * one another, so this code works for both situations. */
237 sci_dev->connection_rate = min_t(u16,
238 scic_sds_port_get_max_allowed_speed(sci_dev->owning_port),
239 discover_response->u2.sas1_1.negotiated_physical_link_rate
242 /* / @todo Should I assign the port width by reading all of the phys on the port? */
243 sci_dev->device_port_width = 1;
249 enum sci_status scic_remote_device_destruct(
250 struct scic_sds_remote_device *sci_dev)
252 return sci_dev->state_handlers->parent.destruct_handler(&sci_dev->parent);
256 enum sci_status scic_remote_device_start(
257 struct scic_sds_remote_device *sci_dev,
260 return sci_dev->state_handlers->parent.start_handler(&sci_dev->parent);
264 enum sci_status scic_remote_device_stop(
265 struct scic_sds_remote_device *sci_dev,
268 return sci_dev->state_handlers->parent.stop_handler(&sci_dev->parent);
272 enum sci_status scic_remote_device_reset(
273 struct scic_sds_remote_device *sci_dev)
275 return sci_dev->state_handlers->parent.reset_handler(&sci_dev->parent);
279 enum sci_status scic_remote_device_reset_complete(
280 struct scic_sds_remote_device *sci_dev)
282 return sci_dev->state_handlers->parent.reset_complete_handler(&sci_dev->parent);
286 enum sci_sas_link_rate scic_remote_device_get_connection_rate(
287 struct scic_sds_remote_device *sci_dev)
289 return sci_dev->connection_rate;
293 void scic_remote_device_get_protocols(
294 struct scic_sds_remote_device *sci_dev,
295 struct smp_discover_response_protocols *pr)
297 pr->u.all = sci_dev->target_protocols.u.all;
300 #if !defined(DISABLE_ATAPI)
301 bool scic_remote_device_is_atapi(struct scic_sds_remote_device *sci_dev)
303 return sci_dev->is_atapi;
309 * *****************************************************************************
310 * * SCU DRIVER STANDARD (SDS) REMOTE DEVICE IMPLEMENTATIONS
311 * ***************************************************************************** */
316 * Remote device timer requirements
318 #define SCIC_SDS_REMOTE_DEVICE_MINIMUM_TIMER_COUNT (0)
319 #define SCIC_SDS_REMOTE_DEVICE_MAXIMUM_TIMER_COUNT (SCI_MAX_REMOTE_DEVICES)
324 * @this_device: The remote device for which the suspend is being requested.
326 * This method invokes the remote device suspend state handler. enum sci_status
328 enum sci_status scic_sds_remote_device_suspend(
329 struct scic_sds_remote_device *this_device,
332 return this_device->state_handlers->suspend_handler(this_device, suspend_type);
337 * @this_device: The remote device for which the resume is being requested.
339 * This method invokes the remote device resume state handler. enum sci_status
341 enum sci_status scic_sds_remote_device_resume(
342 struct scic_sds_remote_device *this_device)
344 return this_device->state_handlers->resume_handler(this_device);
349 * @this_device: The remote device for which the event handling is being
351 * @frame_index: This is the frame index that is being processed.
353 * This method invokes the frame handler for the remote device state machine
356 enum sci_status scic_sds_remote_device_frame_handler(
357 struct scic_sds_remote_device *this_device,
360 return this_device->state_handlers->frame_handler(this_device, frame_index);
365 * @this_device: The remote device for which the event handling is being
367 * @event_code: This is the event code that is to be processed.
369 * This method invokes the remote device event handler. enum sci_status
371 enum sci_status scic_sds_remote_device_event_handler(
372 struct scic_sds_remote_device *this_device,
375 return this_device->state_handlers->event_handler(this_device, event_code);
380 * @controller: The controller that is starting the io request.
381 * @this_device: The remote device for which the start io handling is being
383 * @io_request: The io request that is being started.
385 * This method invokes the remote device start io handler. enum sci_status
387 enum sci_status scic_sds_remote_device_start_io(
388 struct scic_sds_controller *controller,
389 struct scic_sds_remote_device *this_device,
390 struct scic_sds_request *io_request)
392 return this_device->state_handlers->parent.start_io_handler(
393 &this_device->parent, &io_request->parent);
398 * @controller: The controller that is completing the io request.
399 * @this_device: The remote device for which the complete io handling is being
401 * @io_request: The io request that is being completed.
403 * This method invokes the remote device complete io handler. enum sci_status
405 enum sci_status scic_sds_remote_device_complete_io(
406 struct scic_sds_controller *controller,
407 struct scic_sds_remote_device *this_device,
408 struct scic_sds_request *io_request)
410 return this_device->state_handlers->parent.complete_io_handler(
411 &this_device->parent, &io_request->parent);
416 * @controller: The controller that is starting the task request.
417 * @this_device: The remote device for which the start task handling is being
419 * @io_request: The task request that is being started.
421 * This method invokes the remote device start task handler. enum sci_status
423 enum sci_status scic_sds_remote_device_start_task(
424 struct scic_sds_controller *controller,
425 struct scic_sds_remote_device *this_device,
426 struct scic_sds_request *io_request)
428 return this_device->state_handlers->parent.start_task_handler(
429 &this_device->parent, &io_request->parent);
434 * @controller: The controller that is completing the task request.
435 * @this_device: The remote device for which the complete task handling is
437 * @io_request: The task request that is being completed.
439 * This method invokes the remote device complete task handler. enum sci_status
447 * This method takes the request and bulids an appropriate SCU context for the
448 * request and then requests the controller to post the request. none
450 void scic_sds_remote_device_post_request(
451 struct scic_sds_remote_device *this_device,
456 context = scic_sds_remote_device_build_command_context(this_device, request);
458 scic_sds_controller_post_request(
459 scic_sds_remote_device_get_controller(this_device),
464 #if !defined(DISABLE_ATAPI)
467 * @this_device: The device to be checked.
469 * This method check the signature fis of a stp device to decide whether a
470 * device is atapi or not. true if a device is atapi device. False if a device
473 bool scic_sds_remote_device_is_atapi(
474 struct scic_sds_remote_device *this_device)
476 if (!this_device->target_protocols.u.bits.attached_stp_target)
478 else if (this_device->is_direct_attached) {
479 struct scic_sds_phy *phy;
480 struct scic_sata_phy_properties properties;
481 struct sata_fis_reg_d2h *signature_fis;
482 phy = scic_sds_port_get_a_connected_phy(this_device->owning_port);
483 scic_sata_phy_get_properties(phy, &properties);
485 /* decode the signature fis. */
486 signature_fis = &(properties.signature_fis);
488 if ((signature_fis->sector_count == 0x01)
489 && (signature_fis->lba_low == 0x01)
490 && (signature_fis->lba_mid == 0x14)
491 && (signature_fis->lba_high == 0xEB)
492 && ((signature_fis->device & 0x5F) == 0x00)
494 /* An ATA device supporting the PACKET command set. */
499 /* Expander supported ATAPI device is not currently supported. */
505 * This file is provided under a dual BSD/GPLv2 license. When using or
506 * redistributing this file, you may do so under either license.
508 * GPL LICENSE SUMMARY
510 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
512 * This program is free software; you can redistribute it and/or modify
513 * it under the terms of version 2 of the GNU General Public License as
514 * published by the Free Software Foundation.
516 * This program is distributed in the hope that it will be useful, but
517 * WITHOUT ANY WARRANTY; without even the implied warranty of
518 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
519 * General Public License for more details.
521 * You should have received a copy of the GNU General Public License
522 * along with this program; if not, write to the Free Software
523 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
524 * The full GNU General Public License is included in this distribution
525 * in the file called LICENSE.GPL.
529 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
530 * All rights reserved.
532 * Redistribution and use in source and binary forms, with or without
533 * modification, are permitted provided that the following conditions
536 * * Redistributions of source code must retain the above copyright
537 * notice, this list of conditions and the following disclaimer.
538 * * Redistributions in binary form must reproduce the above copyright
539 * notice, this list of conditions and the following disclaimer in
540 * the documentation and/or other materials provided with the
542 * * Neither the name of Intel Corporation nor the names of its
543 * contributors may be used to endorse or promote products derived
544 * from this software without specific prior written permission.
546 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
547 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
548 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
549 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
550 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
551 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
552 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
553 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
554 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
555 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
556 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
560 * This file contains the state handlers for the struct scic_sds_remote_device for the
561 * base state machine.
566 #include "sci_environment.h"
567 #include "scic_user_callback.h"
568 #include "scic_controller.h"
569 #include "scic_sds_remote_device.h"
570 #include "scic_sds_controller.h"
571 #include "scic_sds_port.h"
572 #include "scic_sds_request.h"
573 #include "scic_sds_remote_node_context.h"
574 #include "scu_event_codes.h"
577 * *****************************************************************************
578 * * PROTECTED METHODS
579 * ***************************************************************************** */
583 * @user_parameter: This is cast to a remote device object.
585 * This method is called once the remote node context is ready to be freed.
586 * The remote device can now report that its stop operation is complete. none
588 static void scic_sds_cb_remote_device_rnc_destruct_complete(
589 void *user_parameter)
591 struct scic_sds_remote_device *this_device;
593 this_device = (struct scic_sds_remote_device *)user_parameter;
595 BUG_ON(this_device->started_request_count != 0);
597 sci_base_state_machine_change_state(
598 scic_sds_remote_device_get_base_state_machine(this_device),
599 SCI_BASE_REMOTE_DEVICE_STATE_STOPPED
605 * @user_parameter: This is cast to a remote device object.
607 * This method is called once the remote node context has transisitioned to a
608 * ready state. This is the indication that the remote device object can also
609 * transition to ready. none
611 static void scic_sds_remote_device_resume_complete_handler(
612 void *user_parameter)
614 struct scic_sds_remote_device *this_device;
616 this_device = (struct scic_sds_remote_device *)user_parameter;
619 sci_base_state_machine_get_state(&this_device->parent.state_machine)
620 != SCI_BASE_REMOTE_DEVICE_STATE_READY
622 sci_base_state_machine_change_state(
623 &this_device->parent.state_machine,
624 SCI_BASE_REMOTE_DEVICE_STATE_READY
631 * @device: This parameter specifies the device for which the request is being
633 * @request: This parameter specifies the request being started.
634 * @status: This parameter specifies the current start operation status.
636 * This method will perform the STP request start processing common to IO
637 * requests and task requests of all types. none
639 void scic_sds_remote_device_start_request(
640 struct scic_sds_remote_device *this_device,
641 struct scic_sds_request *the_request,
642 enum sci_status status)
644 /* We still have a fault in starting the io complete it on the port */
645 if (status == SCI_SUCCESS)
646 scic_sds_remote_device_increment_request_count(this_device);
648 this_device->owning_port->state_handlers->complete_io_handler(
649 this_device->owning_port, this_device, the_request
657 * @request: This parameter specifies the request being continued.
659 * This method will continue to post tc for a STP request. This method usually
660 * serves as a callback when RNC gets resumed during a task management
663 void scic_sds_remote_device_continue_request(
664 struct scic_sds_remote_device *this_device)
666 /* we need to check if this request is still valid to continue. */
667 if (this_device->working_request != NULL) {
668 struct scic_sds_request *this_request = this_device->working_request;
669 struct scic_sds_controller *scic = this_request->owning_controller;
670 u32 state = scic->parent.state_machine.current_state_id;
671 sci_base_controller_request_handler_t continue_io;
673 continue_io = scic_sds_controller_state_handler_table[state].base.continue_io;
674 continue_io(&scic->parent, &this_request->target_device->parent,
675 &this_request->parent);
681 * @user_parameter: This is cast to a remote device object.
683 * This method is called once the remote node context has reached a suspended
684 * state. The remote device can now report that its suspend operation is
689 * This method will terminate all of the IO requests in the controllers IO
690 * request table that were targeted for this device.
691 * @this_device: This parameter specifies the remote device for which to
692 * attempt to terminate all requests.
694 * This method returns an indication as to whether all requests were
695 * successfully terminated. If a single request fails to be terminated, then
696 * this method will return the failure.
698 static enum sci_status scic_sds_remote_device_terminate_requests(
699 struct scic_sds_remote_device *this_device)
701 enum sci_status status = SCI_SUCCESS;
702 enum sci_status terminate_status = SCI_SUCCESS;
703 struct scic_sds_request *the_request;
705 u32 request_count = this_device->started_request_count;
708 (index < SCI_MAX_IO_REQUESTS) && (request_count > 0);
710 the_request = this_device->owning_port->owning_controller->io_request_table[index];
712 if ((the_request != NULL) && (the_request->target_device == this_device)) {
713 terminate_status = scic_controller_terminate_request(
714 this_device->owning_port->owning_controller,
719 if (terminate_status != SCI_SUCCESS)
720 status = terminate_status;
730 * *****************************************************************************
731 * * DEFAULT STATE HANDLERS
732 * ***************************************************************************** */
736 * @device: The struct sci_base_remote_device which is then cast into a
737 * struct scic_sds_remote_device.
739 * This method is the default start handler. It logs a warning and returns a
740 * failure. enum sci_status SCI_FAILURE_INVALID_STATE
742 enum sci_status scic_sds_remote_device_default_start_handler(
743 struct sci_base_remote_device *device)
745 struct scic_sds_remote_device *sds_device =
746 (struct scic_sds_remote_device *)device;
748 dev_warn(scirdev_to_dev(sds_device),
749 "%s: SCIC Remote Device requested to start while in wrong "
752 sci_base_state_machine_get_state(
753 scic_sds_remote_device_get_base_state_machine(
756 return SCI_FAILURE_INVALID_STATE;
761 * @device: The struct sci_base_remote_device which is then cast into a
762 * struct scic_sds_remote_device.
764 * This method is the default stop handler. It logs a warning and returns a
765 * failure. enum sci_status SCI_FAILURE_INVALID_STATE
767 static enum sci_status scic_sds_remote_device_default_stop_handler(
768 struct sci_base_remote_device *device)
770 struct scic_sds_remote_device *sds_device =
771 (struct scic_sds_remote_device *)device;
773 dev_warn(scirdev_to_dev(sds_device),
774 "%s: SCIC Remote Device requested to stop while in wrong "
777 sci_base_state_machine_get_state(
778 scic_sds_remote_device_get_base_state_machine(
781 return SCI_FAILURE_INVALID_STATE;
786 * @device: The struct sci_base_remote_device which is then cast into a
787 * struct scic_sds_remote_device.
789 * This method is the default fail handler. It logs a warning and returns a
790 * failure. enum sci_status SCI_FAILURE_INVALID_STATE
792 enum sci_status scic_sds_remote_device_default_fail_handler(
793 struct sci_base_remote_device *device)
795 struct scic_sds_remote_device *sds_device =
796 (struct scic_sds_remote_device *)device;
798 dev_warn(scirdev_to_dev(sds_device),
799 "%s: SCIC Remote Device requested to fail while in wrong "
802 sci_base_state_machine_get_state(
803 scic_sds_remote_device_get_base_state_machine(
806 return SCI_FAILURE_INVALID_STATE;
811 * @device: The struct sci_base_remote_device which is then cast into a
812 * struct scic_sds_remote_device.
814 * This method is the default destruct handler. It logs a warning and returns
815 * a failure. enum sci_status SCI_FAILURE_INVALID_STATE
817 enum sci_status scic_sds_remote_device_default_destruct_handler(
818 struct sci_base_remote_device *device)
820 struct scic_sds_remote_device *sds_device =
821 (struct scic_sds_remote_device *)device;
823 dev_warn(scirdev_to_dev(sds_device),
824 "%s: SCIC Remote Device requested to destroy while in "
827 sci_base_state_machine_get_state(
828 scic_sds_remote_device_get_base_state_machine(
831 return SCI_FAILURE_INVALID_STATE;
836 * @device: The struct sci_base_remote_device which is then cast into a
837 * struct scic_sds_remote_device.
839 * This method is the default reset handler. It logs a warning and returns a
840 * failure. enum sci_status SCI_FAILURE_INVALID_STATE
842 enum sci_status scic_sds_remote_device_default_reset_handler(
843 struct sci_base_remote_device *device)
845 struct scic_sds_remote_device *sds_device =
846 (struct scic_sds_remote_device *)device;
848 dev_warn(scirdev_to_dev(sds_device),
849 "%s: SCIC Remote Device requested to reset while in wrong "
852 sci_base_state_machine_get_state(
853 scic_sds_remote_device_get_base_state_machine(
856 return SCI_FAILURE_INVALID_STATE;
861 * @device: The struct sci_base_remote_device which is then cast into a
862 * struct scic_sds_remote_device.
864 * This method is the default reset complete handler. It logs a warning and
865 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE
867 enum sci_status scic_sds_remote_device_default_reset_complete_handler(
868 struct sci_base_remote_device *device)
870 struct scic_sds_remote_device *sds_device =
871 (struct scic_sds_remote_device *)device;
873 dev_warn(scirdev_to_dev(sds_device),
874 "%s: SCIC Remote Device requested to complete reset while "
875 "in wrong state %d\n",
877 sci_base_state_machine_get_state(
878 scic_sds_remote_device_get_base_state_machine(
881 return SCI_FAILURE_INVALID_STATE;
886 * @device: The struct sci_base_remote_device which is then cast into a
887 * struct scic_sds_remote_device.
889 * This method is the default suspend handler. It logs a warning and returns a
890 * failure. enum sci_status SCI_FAILURE_INVALID_STATE
892 enum sci_status scic_sds_remote_device_default_suspend_handler(
893 struct scic_sds_remote_device *this_device,
896 dev_warn(scirdev_to_dev(this_device),
897 "%s: SCIC Remote Device 0x%p requested to suspend %d while "
898 "in wrong state %d\n",
902 sci_base_state_machine_get_state(
903 scic_sds_remote_device_get_base_state_machine(
906 return SCI_FAILURE_INVALID_STATE;
911 * @device: The struct sci_base_remote_device which is then cast into a
912 * struct scic_sds_remote_device.
914 * This method is the default resume handler. It logs a warning and returns a
915 * failure. enum sci_status SCI_FAILURE_INVALID_STATE
917 enum sci_status scic_sds_remote_device_default_resume_handler(
918 struct scic_sds_remote_device *this_device)
920 dev_warn(scirdev_to_dev(this_device),
921 "%s: SCIC Remote Device requested to resume while in "
924 sci_base_state_machine_get_state(
925 scic_sds_remote_device_get_base_state_machine(
928 return SCI_FAILURE_INVALID_STATE;
933 * @device: The struct sci_base_remote_device which is then cast into a
934 * struct scic_sds_remote_device.
935 * @event_code: The event code that the struct scic_sds_controller wants the device
938 * This method is the default event handler. It will call the RNC state
939 * machine handler for any RNC events otherwise it will log a warning and
940 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE
942 static enum sci_status scic_sds_remote_device_core_event_handler(
943 struct scic_sds_remote_device *this_device,
947 enum sci_status status;
949 switch (scu_get_event_type(event_code)) {
950 case SCU_EVENT_TYPE_RNC_OPS_MISC:
951 case SCU_EVENT_TYPE_RNC_SUSPEND_TX:
952 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX:
953 status = scic_sds_remote_node_context_event_handler(this_device->rnc, event_code);
955 case SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT:
957 if (scu_get_event_code(event_code) == SCU_EVENT_IT_NEXUS_TIMEOUT) {
958 status = SCI_SUCCESS;
960 /* Suspend the associated RNC */
961 scic_sds_remote_node_context_suspend(this_device->rnc,
962 SCI_SOFTWARE_SUSPENSION,
965 dev_dbg(scirdev_to_dev(this_device),
966 "%s: device: %p event code: %x: %s\n",
967 __func__, this_device, event_code,
969 ? "I_T_Nexus_Timeout event"
970 : "I_T_Nexus_Timeout event in wrong state");
974 /* Else, fall through and treat as unhandled... */
977 dev_dbg(scirdev_to_dev(this_device),
978 "%s: device: %p event code: %x: %s\n",
979 __func__, this_device, event_code,
982 : "unexpected event in wrong state");
983 status = SCI_FAILURE_INVALID_STATE;
991 * @device: The struct sci_base_remote_device which is then cast into a
992 * struct scic_sds_remote_device.
993 * @event_code: The event code that the struct scic_sds_controller wants the device
996 * This method is the default event handler. It will call the RNC state
997 * machine handler for any RNC events otherwise it will log a warning and
998 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE
1000 static enum sci_status scic_sds_remote_device_default_event_handler(
1001 struct scic_sds_remote_device *this_device,
1004 return scic_sds_remote_device_core_event_handler(this_device,
1011 * @device: The struct sci_base_remote_device which is then cast into a
1012 * struct scic_sds_remote_device.
1013 * @frame_index: The frame index for which the struct scic_sds_controller wants this
1014 * device object to process.
1016 * This method is the default unsolicited frame handler. It logs a warning,
1017 * releases the frame and returns a failure. enum sci_status
1018 * SCI_FAILURE_INVALID_STATE
1020 enum sci_status scic_sds_remote_device_default_frame_handler(
1021 struct scic_sds_remote_device *this_device,
1024 dev_warn(scirdev_to_dev(this_device),
1025 "%s: SCIC Remote Device requested to handle frame %x "
1026 "while in wrong state %d\n",
1029 sci_base_state_machine_get_state(
1030 &this_device->parent.state_machine));
1032 /* Return the frame back to the controller */
1033 scic_sds_controller_release_frame(
1034 scic_sds_remote_device_get_controller(this_device), frame_index
1037 return SCI_FAILURE_INVALID_STATE;
1042 * @device: The struct sci_base_remote_device which is then cast into a
1043 * struct scic_sds_remote_device.
1044 * @request: The struct sci_base_request which is then cast into a SCIC_SDS_IO_REQUEST
1047 * This method is the default start io handler. It logs a warning and returns
1048 * a failure. enum sci_status SCI_FAILURE_INVALID_STATE
1050 enum sci_status scic_sds_remote_device_default_start_request_handler(
1051 struct sci_base_remote_device *device,
1052 struct sci_base_request *request)
1054 struct scic_sds_remote_device *sds_device =
1055 (struct scic_sds_remote_device *)device;
1057 dev_warn(scirdev_to_dev(sds_device),
1058 "%s: SCIC Remote Device requested to start io request %p "
1059 "while in wrong state %d\n",
1062 sci_base_state_machine_get_state(
1063 scic_sds_remote_device_get_base_state_machine(
1064 (struct scic_sds_remote_device *)device)));
1066 return SCI_FAILURE_INVALID_STATE;
1071 * @device: The struct sci_base_remote_device which is then cast into a
1072 * struct scic_sds_remote_device.
1073 * @request: The struct sci_base_request which is then cast into a SCIC_SDS_IO_REQUEST
1076 * This method is the default complete io handler. It logs a warning and
1077 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE
1079 enum sci_status scic_sds_remote_device_default_complete_request_handler(
1080 struct sci_base_remote_device *device,
1081 struct sci_base_request *request)
1083 struct scic_sds_remote_device *sds_device =
1084 (struct scic_sds_remote_device *)device;
1086 dev_warn(scirdev_to_dev(sds_device),
1087 "%s: SCIC Remote Device requested to complete io_request %p "
1088 "while in wrong state %d\n",
1091 sci_base_state_machine_get_state(
1092 scic_sds_remote_device_get_base_state_machine(
1095 return SCI_FAILURE_INVALID_STATE;
1100 * @device: The struct sci_base_remote_device which is then cast into a
1101 * struct scic_sds_remote_device.
1102 * @request: The struct sci_base_request which is then cast into a SCIC_SDS_IO_REQUEST
1105 * This method is the default continue io handler. It logs a warning and
1106 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE
1108 enum sci_status scic_sds_remote_device_default_continue_request_handler(
1109 struct sci_base_remote_device *device,
1110 struct sci_base_request *request)
1112 struct scic_sds_remote_device *sds_device =
1113 (struct scic_sds_remote_device *)device;
1115 dev_warn(scirdev_to_dev(sds_device),
1116 "%s: SCIC Remote Device requested to continue io request %p "
1117 "while in wrong state %d\n",
1120 sci_base_state_machine_get_state(
1121 scic_sds_remote_device_get_base_state_machine(
1124 return SCI_FAILURE_INVALID_STATE;
1129 * @device: The struct sci_base_remote_device which is then cast into a
1130 * struct scic_sds_remote_device.
1131 * @request: The struct sci_base_request which is then cast into a SCIC_SDS_IO_REQUEST
1134 * This method is the default complete task handler. It logs a warning and
1135 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE
1139 * *****************************************************************************
1140 * * NORMAL STATE HANDLERS
1141 * ***************************************************************************** */
1145 * @device: The struct sci_base_remote_device which is then cast into a
1146 * struct scic_sds_remote_device.
1147 * @frame_index: The frame index for which the struct scic_sds_controller wants this
1148 * device object to process.
1150 * This method is a general ssp frame handler. In most cases the device object
1151 * needs to route the unsolicited frame processing to the io request object.
1152 * This method decodes the tag for the io request object and routes the
1153 * unsolicited frame to that object. enum sci_status SCI_FAILURE_INVALID_STATE
1155 enum sci_status scic_sds_remote_device_general_frame_handler(
1156 struct scic_sds_remote_device *this_device,
1159 enum sci_status result;
1160 struct sci_ssp_frame_header *frame_header;
1161 struct scic_sds_request *io_request;
1163 result = scic_sds_unsolicited_frame_control_get_header(
1164 &(scic_sds_remote_device_get_controller(this_device)->uf_control),
1166 (void **)&frame_header
1169 if (SCI_SUCCESS == result) {
1170 io_request = scic_sds_controller_get_io_request_from_tag(
1171 scic_sds_remote_device_get_controller(this_device), frame_header->tag);
1173 if ((io_request == SCI_INVALID_HANDLE)
1174 || (io_request->target_device != this_device)) {
1176 * We could not map this tag to a valid IO request
1177 * Just toss the frame and continue */
1178 scic_sds_controller_release_frame(
1179 scic_sds_remote_device_get_controller(this_device), frame_index
1182 /* The IO request is now in charge of releasing the frame */
1183 result = io_request->state_handlers->frame_handler(
1184 io_request, frame_index);
1193 * @[in]: this_device This is the device object that is receiving the event.
1194 * @[in]: event_code The event code to process.
1196 * This is a common method for handling events reported to the remote device
1197 * from the controller object. enum sci_status
1199 enum sci_status scic_sds_remote_device_general_event_handler(
1200 struct scic_sds_remote_device *this_device,
1203 return scic_sds_remote_device_core_event_handler(this_device,
1209 * *****************************************************************************
1210 * * STOPPED STATE HANDLERS
1211 * ***************************************************************************** */
1217 * This method takes the struct scic_sds_remote_device from a stopped state and
1218 * attempts to start it. The RNC buffer for the device is constructed and the
1219 * device state machine is transitioned to the
1220 * SCIC_BASE_REMOTE_DEVICE_STATE_STARTING. enum sci_status SCI_SUCCESS if there is
1221 * an RNC buffer available to construct the remote device.
1222 * SCI_FAILURE_INSUFFICIENT_RESOURCES if there is no RNC buffer available in
1223 * which to construct the remote device.
1225 static enum sci_status scic_sds_remote_device_stopped_state_start_handler(
1226 struct sci_base_remote_device *device)
1228 enum sci_status status;
1229 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1231 status = scic_sds_remote_node_context_resume(
1233 scic_sds_remote_device_resume_complete_handler,
1237 if (status == SCI_SUCCESS) {
1238 sci_base_state_machine_change_state(
1239 scic_sds_remote_device_get_base_state_machine(this_device),
1240 SCI_BASE_REMOTE_DEVICE_STATE_STARTING
1249 * @this_device: The struct sci_base_remote_device which is cast into a
1250 * struct scic_sds_remote_device.
1252 * This method will stop a struct scic_sds_remote_device that is already in a stopped
1253 * state. This is not considered an error since the device is already stopped.
1254 * enum sci_status SCI_SUCCESS
1256 static enum sci_status scic_sds_remote_device_stopped_state_stop_handler(
1257 struct sci_base_remote_device *this_device)
1264 * @this_device: The struct sci_base_remote_device which is cast into a
1265 * struct scic_sds_remote_device.
1267 * This method will destruct a struct scic_sds_remote_device that is in a stopped
1268 * state. This is the only state from which a destruct request will succeed.
1269 * The RNi for this struct scic_sds_remote_device is returned to the free pool and the
1270 * device object transitions to the SCI_BASE_REMOTE_DEVICE_STATE_FINAL.
1271 * enum sci_status SCI_SUCCESS
1273 static enum sci_status scic_sds_remote_device_stopped_state_destruct_handler(
1274 struct sci_base_remote_device *device)
1276 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1278 scic_sds_controller_free_remote_node_context(
1279 scic_sds_remote_device_get_controller(this_device),
1281 this_device->rnc->remote_node_index
1284 scic_sds_remote_node_context_set_remote_node_index(
1286 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX
1289 scic_sds_port_set_direct_attached_device_id(
1290 this_device->owning_port,
1291 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX
1294 sci_base_state_machine_change_state(
1295 scic_sds_remote_device_get_base_state_machine(this_device),
1296 SCI_BASE_REMOTE_DEVICE_STATE_FINAL
1303 * *****************************************************************************
1304 * * STARTING STATE HANDLERS
1305 * ***************************************************************************** */
1307 static enum sci_status scic_sds_remote_device_starting_state_stop_handler(
1308 struct sci_base_remote_device *device)
1310 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1313 * This device has not yet started so there had better be no IO requests
1315 BUG_ON(this_device->started_request_count != 0);
1318 * Destroy the remote node context
1320 scic_sds_remote_node_context_destruct(
1322 scic_sds_cb_remote_device_rnc_destruct_complete,
1327 * Transition to the stopping state and wait for the remote node to
1328 * complete being posted and invalidated.
1330 sci_base_state_machine_change_state(
1331 scic_sds_remote_device_get_base_state_machine(this_device),
1332 SCI_BASE_REMOTE_DEVICE_STATE_STOPPING
1339 * *****************************************************************************
1340 * * INITIALIZING STATE HANDLERS
1341 * ***************************************************************************** */
1343 /* There is nothing to do here for SSP devices */
1346 * *****************************************************************************
1347 * * READY STATE HANDLERS
1348 * ***************************************************************************** */
1352 * @this_device: The struct scic_sds_remote_device object to be suspended.
1354 * This method is the resume handler for the struct scic_sds_remote_device object. It
1355 * will post an RNC resume to the SCU hardware. enum sci_status SCI_SUCCESS
1360 * @device: The struct sci_base_remote_device object which is cast to a
1361 * struct scic_sds_remote_device object.
1363 * This method is the default stop handler for the struct scic_sds_remote_device ready
1364 * substate machine. It will stop the current substate machine and transition
1365 * the base state machine to SCI_BASE_REMOTE_DEVICE_STATE_STOPPING. enum sci_status
1368 enum sci_status scic_sds_remote_device_ready_state_stop_handler(
1369 struct sci_base_remote_device *device)
1371 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1372 enum sci_status status = SCI_SUCCESS;
1374 /* Request the parent state machine to transition to the stopping state */
1375 sci_base_state_machine_change_state(
1376 scic_sds_remote_device_get_base_state_machine(this_device),
1377 SCI_BASE_REMOTE_DEVICE_STATE_STOPPING
1380 if (this_device->started_request_count == 0) {
1381 scic_sds_remote_node_context_destruct(
1383 scic_sds_cb_remote_device_rnc_destruct_complete,
1387 status = scic_sds_remote_device_terminate_requests(this_device);
1394 * @device: The struct sci_base_remote_device object which is cast to a
1395 * struct scic_sds_remote_device object.
1397 * This is the ready state device reset handler enum sci_status
1399 enum sci_status scic_sds_remote_device_ready_state_reset_handler(
1400 struct sci_base_remote_device *device)
1402 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1404 /* Request the parent state machine to transition to the stopping state */
1405 sci_base_state_machine_change_state(
1406 scic_sds_remote_device_get_base_state_machine(this_device),
1407 SCI_BASE_REMOTE_DEVICE_STATE_RESETTING
1415 * @device: The struct sci_base_remote_device object which is cast to a
1416 * struct scic_sds_remote_device object.
1418 * This is the default fail handler for the struct scic_sds_remote_device ready
1419 * substate machine. It will stop the current ready substate and transition
1420 * the remote device object to the SCI_BASE_REMOTE_DEVICE_STATE_FAILED.
1421 * enum sci_status SCI_SUCCESS
1426 * @device: The struct sci_base_remote_device which is cast to a
1427 * struct scic_sds_remote_device for which the request is to be started.
1428 * @request: The struct sci_base_request which is cast to a SCIC_SDS_IO_REQUEST that
1431 * This method will attempt to start a task request for this device object. The
1432 * remote device object will issue the start request for the task and if
1433 * successful it will start the request for the port object then increment its
1434 * own requet count. enum sci_status SCI_SUCCESS if the task request is started for
1435 * this device object. SCI_FAILURE_INSUFFICIENT_RESOURCES if the io request
1436 * object could not get the resources to start.
1438 static enum sci_status scic_sds_remote_device_ready_state_start_task_handler(
1439 struct sci_base_remote_device *device,
1440 struct sci_base_request *request)
1442 enum sci_status result;
1443 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1444 struct scic_sds_request *task_request = (struct scic_sds_request *)request;
1446 /* See if the port is in a state where we can start the IO request */
1447 result = scic_sds_port_start_io(
1448 scic_sds_remote_device_get_port(this_device), this_device, task_request);
1450 if (result == SCI_SUCCESS) {
1451 result = scic_sds_remote_node_context_start_task(
1452 this_device->rnc, task_request
1455 if (result == SCI_SUCCESS) {
1456 result = scic_sds_request_start(task_request);
1459 scic_sds_remote_device_start_request(this_device, task_request, result);
1467 * @device: The struct sci_base_remote_device which is cast to a
1468 * struct scic_sds_remote_device for which the request is to be started.
1469 * @request: The struct sci_base_request which is cast to a SCIC_SDS_IO_REQUEST that
1472 * This method will attempt to start an io request for this device object. The
1473 * remote device object will issue the start request for the io and if
1474 * successful it will start the request for the port object then increment its
1475 * own requet count. enum sci_status SCI_SUCCESS if the io request is started for
1476 * this device object. SCI_FAILURE_INSUFFICIENT_RESOURCES if the io request
1477 * object could not get the resources to start.
1479 static enum sci_status scic_sds_remote_device_ready_state_start_io_handler(
1480 struct sci_base_remote_device *device,
1481 struct sci_base_request *request)
1483 enum sci_status result;
1484 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1485 struct scic_sds_request *io_request = (struct scic_sds_request *)request;
1487 /* See if the port is in a state where we can start the IO request */
1488 result = scic_sds_port_start_io(
1489 scic_sds_remote_device_get_port(this_device), this_device, io_request);
1491 if (result == SCI_SUCCESS) {
1492 result = scic_sds_remote_node_context_start_io(
1493 this_device->rnc, io_request
1496 if (result == SCI_SUCCESS) {
1497 result = scic_sds_request_start(io_request);
1500 scic_sds_remote_device_start_request(this_device, io_request, result);
1508 * @device: The struct sci_base_remote_device which is cast to a
1509 * struct scic_sds_remote_device for which the request is to be completed.
1510 * @request: The struct sci_base_request which is cast to a SCIC_SDS_IO_REQUEST that
1511 * is to be completed.
1513 * This method will complete the request for the remote device object. The
1514 * method will call the completion handler for the request object and if
1515 * successful it will complete the request on the port object then decrement
1516 * its own started_request_count. enum sci_status
1518 static enum sci_status scic_sds_remote_device_ready_state_complete_request_handler(
1519 struct sci_base_remote_device *device,
1520 struct sci_base_request *request)
1522 enum sci_status result;
1523 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1524 struct scic_sds_request *the_request = (struct scic_sds_request *)request;
1526 result = scic_sds_request_complete(the_request);
1528 if (result == SCI_SUCCESS) {
1529 /* See if the port is in a state where we can start the IO request */
1530 result = scic_sds_port_complete_io(
1531 scic_sds_remote_device_get_port(this_device), this_device, the_request);
1533 if (result == SCI_SUCCESS) {
1534 scic_sds_remote_device_decrement_request_count(this_device);
1542 * *****************************************************************************
1543 * * STOPPING STATE HANDLERS
1544 * ***************************************************************************** */
1548 * @this_device: The struct sci_base_remote_device which is cast into a
1549 * struct scic_sds_remote_device.
1551 * This method will stop a struct scic_sds_remote_device that is already in the
1552 * SCI_BASE_REMOTE_DEVICE_STATE_STOPPING state. This is not considered an error
1553 * since we allow a stop request on a device that is alreay stopping or
1554 * stopped. enum sci_status SCI_SUCCESS
1556 static enum sci_status scic_sds_remote_device_stopping_state_stop_handler(
1557 struct sci_base_remote_device *device)
1560 * All requests should have been terminated, but if there is an
1561 * attempt to stop a device already in the stopping state, then
1562 * try again to terminate. */
1563 return scic_sds_remote_device_terminate_requests(
1564 (struct scic_sds_remote_device *)device);
1570 * @device: The device object for which the request is completing.
1571 * @request: The task request that is being completed.
1573 * This method completes requests for this struct scic_sds_remote_device while it is
1574 * in the SCI_BASE_REMOTE_DEVICE_STATE_STOPPING state. This method calls the
1575 * complete method for the request object and if that is successful the port
1576 * object is called to complete the task request. Then the device object itself
1577 * completes the task request. If struct scic_sds_remote_device started_request_count
1578 * goes to 0 and the invalidate RNC request has completed the device object can
1579 * transition to the SCI_BASE_REMOTE_DEVICE_STATE_STOPPED. enum sci_status
1581 static enum sci_status scic_sds_remote_device_stopping_state_complete_request_handler(
1582 struct sci_base_remote_device *device,
1583 struct sci_base_request *request)
1585 enum sci_status status = SCI_SUCCESS;
1586 struct scic_sds_request *this_request = (struct scic_sds_request *)request;
1587 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1589 status = scic_sds_request_complete(this_request);
1590 if (status == SCI_SUCCESS) {
1591 status = scic_sds_port_complete_io(
1592 scic_sds_remote_device_get_port(this_device),
1597 if (status == SCI_SUCCESS) {
1598 scic_sds_remote_device_decrement_request_count(this_device);
1600 if (scic_sds_remote_device_get_request_count(this_device) == 0) {
1601 scic_sds_remote_node_context_destruct(
1603 scic_sds_cb_remote_device_rnc_destruct_complete,
1614 * *****************************************************************************
1615 * * RESETTING STATE HANDLERS
1616 * ***************************************************************************** */
1620 * @device: The struct sci_base_remote_device which is to be cast into a
1621 * struct scic_sds_remote_device object.
1623 * This method will complete the reset operation when the device is in the
1624 * resetting state. enum sci_status
1626 static enum sci_status scic_sds_remote_device_resetting_state_reset_complete_handler(
1627 struct sci_base_remote_device *device)
1629 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1631 sci_base_state_machine_change_state(
1632 &this_device->parent.state_machine,
1633 SCI_BASE_REMOTE_DEVICE_STATE_READY
1641 * @device: The struct sci_base_remote_device which is to be cast into a
1642 * struct scic_sds_remote_device object.
1644 * This method will stop the remote device while in the resetting state.
1647 static enum sci_status scic_sds_remote_device_resetting_state_stop_handler(
1648 struct sci_base_remote_device *device)
1650 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1652 sci_base_state_machine_change_state(
1653 &this_device->parent.state_machine,
1654 SCI_BASE_REMOTE_DEVICE_STATE_STOPPING
1662 * @device: The device object for which the request is completing.
1663 * @request: The task request that is being completed.
1665 * This method completes requests for this struct scic_sds_remote_device while it is
1666 * in the SCI_BASE_REMOTE_DEVICE_STATE_RESETTING state. This method calls the
1667 * complete method for the request object and if that is successful the port
1668 * object is called to complete the task request. Then the device object itself
1669 * completes the task request. enum sci_status
1671 static enum sci_status scic_sds_remote_device_resetting_state_complete_request_handler(
1672 struct sci_base_remote_device *device,
1673 struct sci_base_request *request)
1675 enum sci_status status = SCI_SUCCESS;
1676 struct scic_sds_request *this_request = (struct scic_sds_request *)request;
1677 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)device;
1679 status = scic_sds_request_complete(this_request);
1681 if (status == SCI_SUCCESS) {
1682 status = scic_sds_port_complete_io(
1683 scic_sds_remote_device_get_port(this_device), this_device, this_request);
1685 if (status == SCI_SUCCESS) {
1686 scic_sds_remote_device_decrement_request_count(this_device);
1694 * *****************************************************************************
1695 * * FAILED STATE HANDLERS
1696 * ***************************************************************************** */
1700 * @device: The struct sci_base_remote_device which is to be cast into a
1701 * struct scic_sds_remote_device object.
1703 * This method handles the remove request for a failed struct scic_sds_remote_device
1704 * object. The method will transition the device object to the
1705 * SCIC_BASE_REMOTE_DEVICE_STATE_STOPPING. enum sci_status SCI_SUCCESS
1708 /* --------------------------------------------------------------------------- */
1710 struct scic_sds_remote_device_state_handler
1711 scic_sds_remote_device_state_handler_table[SCI_BASE_REMOTE_DEVICE_MAX_STATES] =
1713 /* SCI_BASE_REMOTE_DEVICE_STATE_INITIAL */
1716 scic_sds_remote_device_default_start_handler,
1717 scic_sds_remote_device_default_stop_handler,
1718 scic_sds_remote_device_default_fail_handler,
1719 scic_sds_remote_device_default_destruct_handler,
1720 scic_sds_remote_device_default_reset_handler,
1721 scic_sds_remote_device_default_reset_complete_handler,
1722 scic_sds_remote_device_default_start_request_handler,
1723 scic_sds_remote_device_default_complete_request_handler,
1724 scic_sds_remote_device_default_continue_request_handler,
1725 scic_sds_remote_device_default_start_request_handler,
1726 scic_sds_remote_device_default_complete_request_handler
1728 scic_sds_remote_device_default_suspend_handler,
1729 scic_sds_remote_device_default_resume_handler,
1730 scic_sds_remote_device_default_event_handler,
1731 scic_sds_remote_device_default_frame_handler
1733 /* SCI_BASE_REMOTE_DEVICE_STATE_STOPPED */
1736 scic_sds_remote_device_stopped_state_start_handler,
1737 scic_sds_remote_device_stopped_state_stop_handler,
1738 scic_sds_remote_device_default_fail_handler,
1739 scic_sds_remote_device_stopped_state_destruct_handler,
1740 scic_sds_remote_device_default_reset_handler,
1741 scic_sds_remote_device_default_reset_complete_handler,
1742 scic_sds_remote_device_default_start_request_handler,
1743 scic_sds_remote_device_default_complete_request_handler,
1744 scic_sds_remote_device_default_continue_request_handler,
1745 scic_sds_remote_device_default_start_request_handler,
1746 scic_sds_remote_device_default_complete_request_handler
1748 scic_sds_remote_device_default_suspend_handler,
1749 scic_sds_remote_device_default_resume_handler,
1750 scic_sds_remote_device_default_event_handler,
1751 scic_sds_remote_device_default_frame_handler
1753 /* SCI_BASE_REMOTE_DEVICE_STATE_STARTING */
1756 scic_sds_remote_device_default_start_handler,
1757 scic_sds_remote_device_starting_state_stop_handler,
1758 scic_sds_remote_device_default_fail_handler,
1759 scic_sds_remote_device_default_destruct_handler,
1760 scic_sds_remote_device_default_reset_handler,
1761 scic_sds_remote_device_default_reset_complete_handler,
1762 scic_sds_remote_device_default_start_request_handler,
1763 scic_sds_remote_device_default_complete_request_handler,
1764 scic_sds_remote_device_default_continue_request_handler,
1765 scic_sds_remote_device_default_start_request_handler,
1766 scic_sds_remote_device_default_complete_request_handler
1768 scic_sds_remote_device_default_suspend_handler,
1769 scic_sds_remote_device_default_resume_handler,
1770 scic_sds_remote_device_general_event_handler,
1771 scic_sds_remote_device_default_frame_handler
1773 /* SCI_BASE_REMOTE_DEVICE_STATE_READY */
1776 scic_sds_remote_device_default_start_handler,
1777 scic_sds_remote_device_ready_state_stop_handler,
1778 scic_sds_remote_device_default_fail_handler,
1779 scic_sds_remote_device_default_destruct_handler,
1780 scic_sds_remote_device_ready_state_reset_handler,
1781 scic_sds_remote_device_default_reset_complete_handler,
1782 scic_sds_remote_device_ready_state_start_io_handler,
1783 scic_sds_remote_device_ready_state_complete_request_handler,
1784 scic_sds_remote_device_default_continue_request_handler,
1785 scic_sds_remote_device_ready_state_start_task_handler,
1786 scic_sds_remote_device_ready_state_complete_request_handler
1788 scic_sds_remote_device_default_suspend_handler,
1789 scic_sds_remote_device_default_resume_handler,
1790 scic_sds_remote_device_general_event_handler,
1791 scic_sds_remote_device_general_frame_handler,
1793 /* SCI_BASE_REMOTE_DEVICE_STATE_STOPPING */
1796 scic_sds_remote_device_default_start_handler,
1797 scic_sds_remote_device_stopping_state_stop_handler,
1798 scic_sds_remote_device_default_fail_handler,
1799 scic_sds_remote_device_default_destruct_handler,
1800 scic_sds_remote_device_default_reset_handler,
1801 scic_sds_remote_device_default_reset_complete_handler,
1802 scic_sds_remote_device_default_start_request_handler,
1803 scic_sds_remote_device_stopping_state_complete_request_handler,
1804 scic_sds_remote_device_default_continue_request_handler,
1805 scic_sds_remote_device_default_start_request_handler,
1806 scic_sds_remote_device_stopping_state_complete_request_handler
1808 scic_sds_remote_device_default_suspend_handler,
1809 scic_sds_remote_device_default_resume_handler,
1810 scic_sds_remote_device_general_event_handler,
1811 scic_sds_remote_device_general_frame_handler
1813 /* SCI_BASE_REMOTE_DEVICE_STATE_FAILED */
1816 scic_sds_remote_device_default_start_handler,
1817 scic_sds_remote_device_default_stop_handler,
1818 scic_sds_remote_device_default_fail_handler,
1819 scic_sds_remote_device_default_destruct_handler,
1820 scic_sds_remote_device_default_reset_handler,
1821 scic_sds_remote_device_default_reset_complete_handler,
1822 scic_sds_remote_device_default_start_request_handler,
1823 scic_sds_remote_device_default_complete_request_handler,
1824 scic_sds_remote_device_default_continue_request_handler,
1825 scic_sds_remote_device_default_start_request_handler,
1826 scic_sds_remote_device_default_complete_request_handler
1828 scic_sds_remote_device_default_suspend_handler,
1829 scic_sds_remote_device_default_resume_handler,
1830 scic_sds_remote_device_default_event_handler,
1831 scic_sds_remote_device_general_frame_handler
1833 /* SCI_BASE_REMOTE_DEVICE_STATE_RESETTING */
1836 scic_sds_remote_device_default_start_handler,
1837 scic_sds_remote_device_resetting_state_stop_handler,
1838 scic_sds_remote_device_default_fail_handler,
1839 scic_sds_remote_device_default_destruct_handler,
1840 scic_sds_remote_device_default_reset_handler,
1841 scic_sds_remote_device_resetting_state_reset_complete_handler,
1842 scic_sds_remote_device_default_start_request_handler,
1843 scic_sds_remote_device_resetting_state_complete_request_handler,
1844 scic_sds_remote_device_default_continue_request_handler,
1845 scic_sds_remote_device_default_start_request_handler,
1846 scic_sds_remote_device_resetting_state_complete_request_handler
1848 scic_sds_remote_device_default_suspend_handler,
1849 scic_sds_remote_device_default_resume_handler,
1850 scic_sds_remote_device_default_event_handler,
1851 scic_sds_remote_device_general_frame_handler
1853 /* SCI_BASE_REMOTE_DEVICE_STATE_FINAL */
1856 scic_sds_remote_device_default_start_handler,
1857 scic_sds_remote_device_default_stop_handler,
1858 scic_sds_remote_device_default_fail_handler,
1859 scic_sds_remote_device_default_destruct_handler,
1860 scic_sds_remote_device_default_reset_handler,
1861 scic_sds_remote_device_default_reset_complete_handler,
1862 scic_sds_remote_device_default_start_request_handler,
1863 scic_sds_remote_device_default_complete_request_handler,
1864 scic_sds_remote_device_default_continue_request_handler,
1865 scic_sds_remote_device_default_start_request_handler,
1866 scic_sds_remote_device_default_complete_request_handler
1868 scic_sds_remote_device_default_suspend_handler,
1869 scic_sds_remote_device_default_resume_handler,
1870 scic_sds_remote_device_default_event_handler,
1871 scic_sds_remote_device_default_frame_handler
1876 * This file is provided under a dual BSD/GPLv2 license. When using or
1877 * redistributing this file, you may do so under either license.
1879 * GPL LICENSE SUMMARY
1881 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
1883 * This program is free software; you can redistribute it and/or modify
1884 * it under the terms of version 2 of the GNU General Public License as
1885 * published by the Free Software Foundation.
1887 * This program is distributed in the hope that it will be useful, but
1888 * WITHOUT ANY WARRANTY; without even the implied warranty of
1889 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1890 * General Public License for more details.
1892 * You should have received a copy of the GNU General Public License
1893 * along with this program; if not, write to the Free Software
1894 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
1895 * The full GNU General Public License is included in this distribution
1896 * in the file called LICENSE.GPL.
1900 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
1901 * All rights reserved.
1903 * Redistribution and use in source and binary forms, with or without
1904 * modification, are permitted provided that the following conditions
1907 * * Redistributions of source code must retain the above copyright
1908 * notice, this list of conditions and the following disclaimer.
1909 * * Redistributions in binary form must reproduce the above copyright
1910 * notice, this list of conditions and the following disclaimer in
1911 * the documentation and/or other materials provided with the
1913 * * Neither the name of Intel Corporation nor the names of its
1914 * contributors may be used to endorse or promote products derived
1915 * from this software without specific prior written permission.
1917 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1918 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1919 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1920 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1921 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1922 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1923 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1924 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1925 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1926 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1927 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1931 * This file contains the operations that are taken on the enter and exit state
1932 * transitions for the struct sci_base_remote_device state machine.
1937 #include "scic_remote_device.h"
1938 #include "scic_user_callback.h"
1939 #include "scic_sds_controller.h"
1940 #include "scic_sds_remote_device.h"
1941 #include "scic_sds_request.h"
1942 #include "scic_sds_controller.h"
1943 #include "scic_sds_port.h"
1947 * @object: This is the struct sci_base_object that is cast into a
1948 * struct scic_sds_remote_device.
1950 * This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_INITIAL it
1951 * immediatly transitions the remote device object to the stopped state. none
1953 static void scic_sds_remote_device_initial_state_enter(
1954 struct sci_base_object *object)
1956 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
1960 scic_sds_remote_device_state_handler_table,
1961 SCI_BASE_REMOTE_DEVICE_STATE_INITIAL
1964 /* Initial state is a transitional state to the stopped state */
1965 sci_base_state_machine_change_state(
1966 scic_sds_remote_device_get_base_state_machine(this_device),
1967 SCI_BASE_REMOTE_DEVICE_STATE_STOPPED
1973 * @object: This is the struct sci_base_object that is cast into a
1974 * struct scic_sds_remote_device.
1976 * This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_INITIAL it
1977 * sets the stopped state handlers and if this state is entered from the
1978 * SCI_BASE_REMOTE_DEVICE_STATE_STOPPING then the SCI User is informed that the
1979 * device stop is complete. none
1981 static void scic_sds_remote_device_stopped_state_enter(
1982 struct sci_base_object *object)
1984 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
1988 scic_sds_remote_device_state_handler_table,
1989 SCI_BASE_REMOTE_DEVICE_STATE_STOPPED
1993 * If we are entering from the stopping state let the SCI User know that
1994 * the stop operation has completed. */
1995 if (this_device->parent.state_machine.previous_state_id
1996 == SCI_BASE_REMOTE_DEVICE_STATE_STOPPING) {
1997 scic_cb_remote_device_stop_complete(
1998 scic_sds_remote_device_get_controller(this_device),
2007 * @object: This is the struct sci_base_object that is cast into a
2008 * struct scic_sds_remote_device.
2010 * This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_STARTING it
2011 * sets the starting state handlers, sets the device not ready, and posts the
2012 * remote node context to the hardware. none
2014 static void scic_sds_remote_device_starting_state_enter(
2015 struct sci_base_object *object)
2017 struct scic_sds_controller *the_controller;
2018 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2020 the_controller = scic_sds_remote_device_get_controller(this_device);
2024 scic_sds_remote_device_state_handler_table,
2025 SCI_BASE_REMOTE_DEVICE_STATE_STARTING
2028 scic_cb_remote_device_not_ready(
2031 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED
2037 * @object: This is the struct sci_base_object that is cast into a
2038 * struct scic_sds_remote_device.
2040 * This is the exit method for the SCI_BASE_REMOTE_DEVICE_STATE_STARTING it
2041 * reports that the device start is complete. none
2043 static void scic_sds_remote_device_starting_state_exit(
2044 struct sci_base_object *object)
2046 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2049 * / @todo Check the device object for the proper return code for this
2051 scic_cb_remote_device_start_complete(
2052 scic_sds_remote_device_get_controller(this_device),
2060 * @object: This is the struct sci_base_object that is cast into a
2061 * struct scic_sds_remote_device.
2063 * This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_READY it sets
2064 * the ready state handlers, and starts the ready substate machine. none
2066 static void scic_sds_remote_device_ready_state_enter(
2067 struct sci_base_object *object)
2069 struct scic_sds_controller *the_controller;
2070 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2072 the_controller = scic_sds_remote_device_get_controller(this_device);
2076 scic_sds_remote_device_state_handler_table,
2077 SCI_BASE_REMOTE_DEVICE_STATE_READY
2080 the_controller->remote_device_sequence[this_device->rnc->remote_node_index]++;
2082 if (this_device->has_ready_substate_machine) {
2083 sci_base_state_machine_start(&this_device->ready_substate_machine);
2085 scic_cb_remote_device_ready(the_controller, this_device);
2091 * @object: This is the struct sci_base_object that is cast into a
2092 * struct scic_sds_remote_device.
2094 * This is the exit method for the SCI_BASE_REMOTE_DEVICE_STATE_READY it does
2097 static void scic_sds_remote_device_ready_state_exit(
2098 struct sci_base_object *object)
2100 struct scic_sds_controller *the_controller;
2101 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2103 the_controller = scic_sds_remote_device_get_controller(this_device);
2105 if (this_device->has_ready_substate_machine) {
2106 sci_base_state_machine_stop(&this_device->ready_substate_machine);
2108 scic_cb_remote_device_not_ready(
2111 SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED
2118 * @object: This is the struct sci_base_object that is cast into a
2119 * struct scic_sds_remote_device.
2121 * This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_STOPPING it
2122 * sets the stopping state handlers and posts an RNC invalidate request to the
2123 * SCU hardware. none
2125 static void scic_sds_remote_device_stopping_state_enter(
2126 struct sci_base_object *object)
2128 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2132 scic_sds_remote_device_state_handler_table,
2133 SCI_BASE_REMOTE_DEVICE_STATE_STOPPING
2139 * @object: This is the struct sci_base_object that is cast into a
2140 * struct scic_sds_remote_device.
2142 * This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_FAILED it sets
2143 * the stopping state handlers. none
2145 static void scic_sds_remote_device_failed_state_enter(
2146 struct sci_base_object *object)
2148 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2152 scic_sds_remote_device_state_handler_table,
2153 SCI_BASE_REMOTE_DEVICE_STATE_FAILED
2159 * @object: This is the struct sci_base_object that is cast into a
2160 * struct scic_sds_remote_device.
2162 * This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_RESETTING it
2163 * sets the resetting state handlers. none
2165 static void scic_sds_remote_device_resetting_state_enter(
2166 struct sci_base_object *object)
2168 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2172 scic_sds_remote_device_state_handler_table,
2173 SCI_BASE_REMOTE_DEVICE_STATE_RESETTING
2176 scic_sds_remote_node_context_suspend(
2177 this_device->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL);
2182 * @object: This is the struct sci_base_object that is cast into a
2183 * struct scic_sds_remote_device.
2185 * This is the exit method for the SCI_BASE_REMOTE_DEVICE_STATE_RESETTING it
2186 * does nothing. none
2188 static void scic_sds_remote_device_resetting_state_exit(
2189 struct sci_base_object *object)
2191 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2193 scic_sds_port_set_direct_attached_device_id(
2194 scic_sds_remote_device_get_port(this_device),
2195 this_device->rnc->remote_node_index
2198 scic_sds_remote_node_context_resume(this_device->rnc, NULL, NULL);
2203 * @object: This is the struct sci_base_object that is cast into a
2204 * struct scic_sds_remote_device.
2206 * This is the enter method for the SCI_BASE_REMOTE_DEVICE_STATE_FINAL it sets
2207 * the final state handlers. none
2209 static void scic_sds_remote_device_final_state_enter(
2210 struct sci_base_object *object)
2212 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object;
2216 scic_sds_remote_device_state_handler_table,
2217 SCI_BASE_REMOTE_DEVICE_STATE_FINAL
2221 /* --------------------------------------------------------------------------- */
2223 const struct sci_base_state scic_sds_remote_device_state_table[] = {
2224 [SCI_BASE_REMOTE_DEVICE_STATE_INITIAL] = {
2225 .enter_state = scic_sds_remote_device_initial_state_enter,
2227 [SCI_BASE_REMOTE_DEVICE_STATE_STOPPED] = {
2228 .enter_state = scic_sds_remote_device_stopped_state_enter,
2230 [SCI_BASE_REMOTE_DEVICE_STATE_STARTING] = {
2231 .enter_state = scic_sds_remote_device_starting_state_enter,
2232 .exit_state = scic_sds_remote_device_starting_state_exit
2234 [SCI_BASE_REMOTE_DEVICE_STATE_READY] = {
2235 .enter_state = scic_sds_remote_device_ready_state_enter,
2236 .exit_state = scic_sds_remote_device_ready_state_exit
2238 [SCI_BASE_REMOTE_DEVICE_STATE_STOPPING] = {
2239 .enter_state = scic_sds_remote_device_stopping_state_enter,
2241 [SCI_BASE_REMOTE_DEVICE_STATE_FAILED] = {
2242 .enter_state = scic_sds_remote_device_failed_state_enter,
2244 [SCI_BASE_REMOTE_DEVICE_STATE_RESETTING] = {
2245 .enter_state = scic_sds_remote_device_resetting_state_enter,
2246 .exit_state = scic_sds_remote_device_resetting_state_exit
2248 [SCI_BASE_REMOTE_DEVICE_STATE_FINAL] = {
2249 .enter_state = scic_sds_remote_device_final_state_enter,