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 #include "intel_sas.h"
58 #include "intel_sata.h"
59 #include "intel_sat.h"
60 #include "sci_base_request.h"
61 #include "scic_controller.h"
62 #include "scic_io_request.h"
63 #include "scic_remote_device.h"
64 #include "scic_sds_controller.h"
65 #include "scic_sds_controller_registers.h"
66 #include "scic_sds_pci.h"
67 #include "scic_sds_port.h"
68 #include "scic_sds_remote_device.h"
69 #include "scic_sds_request.h"
70 #include "scic_sds_smp_request.h"
71 #include "scic_sds_stp_request.h"
72 #include "scic_sds_unsolicited_frame_control.h"
73 #include "scic_user_callback.h"
74 #include "sci_environment.h"
76 #include "scu_completion_codes.h"
77 #include "scu_constants.h"
78 #include "scu_task_context.h"
80 #if !defined(DISABLE_ATAPI)
81 #include "scic_sds_stp_packet_request.h"
85 * ****************************************************************************
86 * * SCIC SDS IO REQUEST CONSTANTS
87 * **************************************************************************** */
92 * We have no timer requirements for IO requests right now
94 #define SCIC_SDS_IO_REQUEST_MINIMUM_TIMER_COUNT (0)
95 #define SCIC_SDS_IO_REQUEST_MAXIMUM_TIMER_COUNT (0)
98 * ****************************************************************************
99 * * SCIC SDS IO REQUEST MACROS
100 * **************************************************************************** */
103 * scic_ssp_io_request_get_object_size() -
105 * This macro returns the sizeof memory required to store the an SSP IO
106 * request. This does not include the size of the SGL or SCU Task Context
109 #define scic_ssp_io_request_get_object_size() \
111 sizeof(struct sci_ssp_command_iu) \
112 + sizeof(struct sci_ssp_response_iu) \
116 * scic_sds_ssp_request_get_command_buffer() -
118 * This macro returns the address of the ssp command buffer in the io request
121 #define scic_sds_ssp_request_get_command_buffer(memory) \
122 ((struct sci_ssp_command_iu *)(\
123 ((char *)(memory)) + sizeof(struct scic_sds_request) \
127 * scic_sds_ssp_request_get_response_buffer() -
129 * This macro returns the address of the ssp response buffer in the io request
132 #define scic_sds_ssp_request_get_response_buffer(memory) \
133 ((struct sci_ssp_response_iu *)(\
134 ((char *)(scic_sds_ssp_request_get_command_buffer(memory))) \
135 + sizeof(struct sci_ssp_command_iu) \
139 * scic_sds_ssp_request_get_task_context_buffer() -
141 * This macro returns the address of the task context buffer in the io request
144 #define scic_sds_ssp_request_get_task_context_buffer(memory) \
145 ((struct scu_task_context *)(\
146 ((char *)(scic_sds_ssp_request_get_response_buffer(memory))) \
147 + sizeof(struct sci_ssp_response_iu) \
151 * scic_sds_ssp_request_get_sgl_element_buffer() -
153 * This macro returns the address of the sgl elment pairs in the io request
156 #define scic_sds_ssp_request_get_sgl_element_buffer(memory) \
157 ((struct scu_sgl_element_pair *)(\
158 ((char *)(scic_sds_ssp_request_get_task_context_buffer(memory))) \
159 + sizeof(struct scu_task_context) \
164 * scic_ssp_task_request_get_object_size() -
166 * This macro returns the sizeof of memory required to store an SSP Task
167 * request. This does not include the size of the SCU Task Context memory.
169 #define scic_ssp_task_request_get_object_size() \
171 sizeof(struct sci_ssp_task_iu) \
172 + sizeof(struct sci_ssp_response_iu) \
176 * scic_sds_ssp_task_request_get_command_buffer() -
178 * This macro returns the address of the ssp command buffer in the task request
179 * memory. Yes its the same as the above macro except for the name.
181 #define scic_sds_ssp_task_request_get_command_buffer(memory) \
182 ((struct sci_ssp_task_iu *)(\
183 ((char *)(memory)) + sizeof(struct scic_sds_request) \
187 * scic_sds_ssp_task_request_get_response_buffer() -
189 * This macro returns the address of the ssp response buffer in the task
192 #define scic_sds_ssp_task_request_get_response_buffer(memory) \
193 ((struct sci_ssp_response_iu *)(\
194 ((char *)(scic_sds_ssp_task_request_get_command_buffer(memory))) \
195 + sizeof(struct sci_ssp_task_iu) \
199 * scic_sds_ssp_task_request_get_task_context_buffer() -
201 * This macro returs the task context buffer for the SSP task request.
203 #define scic_sds_ssp_task_request_get_task_context_buffer(memory) \
204 ((struct scu_task_context *)(\
205 ((char *)(scic_sds_ssp_task_request_get_response_buffer(memory))) \
206 + sizeof(struct sci_ssp_response_iu) \
212 * ****************************************************************************
213 * * SCIC SDS IO REQUEST PRIVATE METHODS
214 * **************************************************************************** */
219 * This method returns the size required to store an SSP IO request object. u32
221 static u32 scic_sds_ssp_request_get_object_size(void)
223 return sizeof(struct scic_sds_request)
224 + scic_ssp_io_request_get_object_size()
225 + sizeof(struct scu_task_context)
227 + sizeof(struct scu_sgl_element_pair) * SCU_MAX_SGL_ELEMENT_PAIRS;
231 * This method returns the sgl element pair for the specificed sgl_pair index.
232 * @this_request: This parameter specifies the IO request for which to retrieve
233 * the Scatter-Gather List element pair.
234 * @sgl_pair_index: This parameter specifies the index into the SGL element
235 * pair to be retrieved.
237 * This method returns a pointer to an struct scu_sgl_element_pair.
239 static struct scu_sgl_element_pair *scic_sds_request_get_sgl_element_pair(
240 struct scic_sds_request *this_request,
243 struct scu_task_context *task_context;
245 task_context = (struct scu_task_context *)this_request->task_context_buffer;
247 if (sgl_pair_index == 0) {
248 return &task_context->sgl_pair_ab;
249 } else if (sgl_pair_index == 1) {
250 return &task_context->sgl_pair_cd;
253 return &this_request->sgl_element_pair_buffer[sgl_pair_index - 2];
257 * This function will build the SGL list for an IO request.
258 * @this_request: This parameter specifies the IO request for which to build
259 * the Scatter-Gather List.
262 void scic_sds_request_build_sgl(struct scic_sds_request *sds_request)
264 struct isci_request *isci_request =
265 (struct isci_request *)sci_object_get_association(sds_request);
266 struct isci_host *isci_host = isci_request->isci_host;
267 struct sas_task *task = isci_request_access_task(isci_request);
268 struct scatterlist *sg = NULL;
271 struct scu_sgl_element_pair *scu_sg = NULL;
272 struct scu_sgl_element_pair *prev_sg = NULL;
274 if (task->num_scatter > 0) {
278 scu_sg = scic_sds_request_get_sgl_element_pair(
282 SCU_SGL_COPY(scu_sg->A, sg);
287 SCU_SGL_COPY(scu_sg->B, sg);
290 SCU_SGL_ZERO(scu_sg->B);
294 scic_io_request_get_dma_addr(
298 prev_sg->next_pair_upper =
299 upper_32_bits(dma_addr);
300 prev_sg->next_pair_lower =
301 lower_32_bits(dma_addr);
307 } else { /* handle when no sg */
308 scu_sg = scic_sds_request_get_sgl_element_pair(sds_request,
311 dma_addr = dma_map_single(&isci_host->pdev->dev,
313 task->total_xfer_len,
316 isci_request->zero_scatter_daddr = dma_addr;
318 scu_sg->A.length = task->total_xfer_len;
319 scu_sg->A.address_upper = upper_32_bits(dma_addr);
320 scu_sg->A.address_lower = lower_32_bits(dma_addr);
324 scu_sg->next_pair_upper = 0;
325 scu_sg->next_pair_lower = 0;
330 * This method initializes common portions of the io request object. This
331 * includes construction of the struct sci_base_request parent.
332 * @the_controller: This parameter specifies the controller for which the
333 * request is being constructed.
334 * @the_target: This parameter specifies the remote device for which the
335 * request is being constructed.
336 * @io_tag: This parameter specifies the IO tag to be utilized for this
337 * request. This parameter can be set to SCI_CONTROLLER_INVALID_IO_TAG.
338 * @user_io_request_object: This parameter specifies the user request object
339 * for which the request is being constructed.
340 * @this_request: This parameter specifies the request being constructed.
343 static void scic_sds_general_request_construct(
344 struct scic_sds_controller *the_controller,
345 struct scic_sds_remote_device *the_target,
347 void *user_io_request_object,
348 struct scic_sds_request *this_request)
350 sci_base_request_construct(
351 &this_request->parent,
352 scic_sds_request_state_table
355 this_request->io_tag = io_tag;
356 this_request->user_request = user_io_request_object;
357 this_request->owning_controller = the_controller;
358 this_request->target_device = the_target;
359 this_request->has_started_substate_machine = false;
360 this_request->protocol = SCIC_NO_PROTOCOL;
361 this_request->saved_rx_frame_index = SCU_INVALID_FRAME_INDEX;
362 this_request->device_sequence = scic_sds_remote_device_get_sequence(the_target);
364 this_request->sci_status = SCI_SUCCESS;
365 this_request->scu_status = 0;
366 this_request->post_context = 0xFFFFFFFF;
368 this_request->is_task_management_request = false;
370 if (io_tag == SCI_CONTROLLER_INVALID_IO_TAG) {
371 this_request->was_tag_assigned_by_user = false;
372 this_request->task_context_buffer = NULL;
374 this_request->was_tag_assigned_by_user = true;
376 this_request->task_context_buffer =
377 scic_sds_controller_get_task_context_buffer(
378 this_request->owning_controller, io_tag);
383 * This method build the remainder of the IO request object.
384 * @this_request: This parameter specifies the request object being constructed.
386 * The scic_sds_general_request_construct() must be called before this call is
389 static void scic_sds_ssp_io_request_assign_buffers(
390 struct scic_sds_request *this_request)
392 this_request->command_buffer =
393 scic_sds_ssp_request_get_command_buffer(this_request);
394 this_request->response_buffer =
395 scic_sds_ssp_request_get_response_buffer(this_request);
396 this_request->sgl_element_pair_buffer =
397 scic_sds_ssp_request_get_sgl_element_buffer(this_request);
398 this_request->sgl_element_pair_buffer =
399 scic_sds_request_align_sgl_element_buffer(this_request->sgl_element_pair_buffer);
401 if (this_request->was_tag_assigned_by_user == false) {
402 this_request->task_context_buffer =
403 scic_sds_ssp_request_get_task_context_buffer(this_request);
404 this_request->task_context_buffer =
405 scic_sds_request_align_task_context_buffer(this_request->task_context_buffer);
410 * This method constructs the SSP Command IU data for this io request object.
411 * @this_request: This parameter specifies the request object for which the SSP
412 * command information unit is being built.
415 static void scic_sds_io_request_build_ssp_command_iu(
416 struct scic_sds_request *this_request)
418 struct sci_ssp_command_iu *command_frame;
424 (struct sci_ssp_command_iu *)this_request->command_buffer;
426 os_handle = scic_sds_request_get_user_request(this_request);
428 command_frame->lun_upper = 0;
429 command_frame->lun_lower = scic_cb_ssp_io_request_get_lun(os_handle);
431 ((u32 *)command_frame)[2] = 0;
433 cdb_length = scic_cb_ssp_io_request_get_cdb_length(os_handle);
434 cdb_buffer = (u32 *)scic_cb_ssp_io_request_get_cdb_address(os_handle);
436 if (cdb_length > 16) {
437 command_frame->additional_cdb_length = cdb_length - 16;
440 /* / @todo Is it ok to leave junk at the end of the cdb buffer? */
441 scic_word_copy_with_swap(
442 (u32 *)(&command_frame->cdb),
444 (cdb_length + 3) / sizeof(u32)
447 command_frame->enable_first_burst = 0;
448 command_frame->task_priority =
449 scic_cb_ssp_io_request_get_command_priority(os_handle);
450 command_frame->task_attribute =
451 scic_cb_ssp_io_request_get_task_attribute(os_handle);
456 * This method constructs the SSP Task IU data for this io request object.
460 static void scic_sds_task_request_build_ssp_task_iu(
461 struct scic_sds_request *this_request)
463 struct sci_ssp_task_iu *command_frame;
467 (struct sci_ssp_task_iu *)this_request->command_buffer;
469 os_handle = scic_sds_request_get_user_request(this_request);
471 command_frame->lun_upper = 0;
472 command_frame->lun_lower = scic_cb_ssp_task_request_get_lun(os_handle);
474 ((u32 *)command_frame)[2] = 0;
476 command_frame->task_function =
477 scic_cb_ssp_task_request_get_function(os_handle);
478 command_frame->task_tag =
479 scic_cb_ssp_task_request_get_io_tag_to_manage(os_handle);
484 * This method is will fill in the SCU Task Context for any type of SSP request.
489 static void scu_ssp_reqeust_construct_task_context(
490 struct scic_sds_request *sds_request,
491 struct scu_task_context *task_context)
494 struct scic_sds_controller *controller;
495 struct scic_sds_remote_device *target_device;
496 struct scic_sds_port *target_port;
498 controller = scic_sds_request_get_controller(sds_request);
499 target_device = scic_sds_request_get_device(sds_request);
500 target_port = scic_sds_request_get_port(sds_request);
502 /* Fill in the TC with the its required data */
503 task_context->abort = 0;
504 task_context->priority = 0;
505 task_context->initiator_request = 1;
506 task_context->connection_rate =
507 scic_remote_device_get_connection_rate(target_device);
508 task_context->protocol_engine_index =
509 scic_sds_controller_get_protocol_engine_group(controller);
510 task_context->logical_port_index =
511 scic_sds_port_get_index(target_port);
512 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SSP;
513 task_context->valid = SCU_TASK_CONTEXT_VALID;
514 task_context->context_type = SCU_TASK_CONTEXT_TYPE;
516 task_context->remote_node_index =
517 scic_sds_remote_device_get_index(sds_request->target_device);
518 task_context->command_code = 0;
520 task_context->link_layer_control = 0;
521 task_context->do_not_dma_ssp_good_response = 1;
522 task_context->strict_ordering = 0;
523 task_context->control_frame = 0;
524 task_context->timeout_enable = 0;
525 task_context->block_guard_enable = 0;
527 task_context->address_modifier = 0;
529 /* task_context->type.ssp.tag = this_request->io_tag; */
530 task_context->task_phase = 0x01;
532 if (sds_request->was_tag_assigned_by_user) {
534 * Build the task context now since we have already read
537 sds_request->post_context =
538 (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
539 (scic_sds_controller_get_protocol_engine_group(
541 SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) |
542 (scic_sds_port_get_index(target_port) <<
543 SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) |
544 scic_sds_io_tag_get_index(sds_request->io_tag));
547 * Build the task context now since we have already read
550 * I/O tag index is not assigned because we have to wait
553 sds_request->post_context =
554 (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
555 (scic_sds_controller_get_protocol_engine_group(
556 owning_controller) <<
557 SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) |
558 (scic_sds_port_get_index(target_port) <<
559 SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT));
563 * Copy the physical address for the command buffer to the
566 dma_addr = scic_io_request_get_dma_addr(sds_request,
567 sds_request->command_buffer);
569 task_context->command_iu_upper = upper_32_bits(dma_addr);
570 task_context->command_iu_lower = lower_32_bits(dma_addr);
573 * Copy the physical address for the response buffer to the
576 dma_addr = scic_io_request_get_dma_addr(sds_request,
577 sds_request->response_buffer);
579 task_context->response_iu_upper = upper_32_bits(dma_addr);
580 task_context->response_iu_lower = lower_32_bits(dma_addr);
584 * This method is will fill in the SCU Task Context for a SSP IO request.
588 static void scu_ssp_io_request_construct_task_context(
589 struct scic_sds_request *sci_req,
590 enum dma_data_direction dir,
593 struct scu_task_context *task_context;
595 task_context = scic_sds_request_get_task_context(sci_req);
597 scu_ssp_reqeust_construct_task_context(sci_req, task_context);
599 task_context->ssp_command_iu_length = sizeof(struct sci_ssp_command_iu) / sizeof(u32);
600 task_context->type.ssp.frame_type = SCI_SAS_COMMAND_FRAME;
603 case DMA_FROM_DEVICE:
606 task_context->task_type = SCU_TASK_TYPE_IOREAD;
609 task_context->task_type = SCU_TASK_TYPE_IOWRITE;
613 task_context->transfer_length_bytes = len;
615 if (task_context->transfer_length_bytes > 0)
616 scic_sds_request_build_sgl(sci_req);
621 * This method will fill in the remainder of the io request object for SSP Task
626 static void scic_sds_ssp_task_request_assign_buffers(
627 struct scic_sds_request *this_request)
629 /* Assign all of the buffer pointers */
630 this_request->command_buffer =
631 scic_sds_ssp_task_request_get_command_buffer(this_request);
632 this_request->response_buffer =
633 scic_sds_ssp_task_request_get_response_buffer(this_request);
634 this_request->sgl_element_pair_buffer = NULL;
636 if (this_request->was_tag_assigned_by_user == false) {
637 this_request->task_context_buffer =
638 scic_sds_ssp_task_request_get_task_context_buffer(this_request);
639 this_request->task_context_buffer =
640 scic_sds_request_align_task_context_buffer(this_request->task_context_buffer);
645 * This method will fill in the SCU Task Context for a SSP Task request. The
646 * following important settings are utilized: -# priority ==
647 * SCU_TASK_PRIORITY_HIGH. This ensures that the task request is issued
648 * ahead of other task destined for the same Remote Node. -# task_type ==
649 * SCU_TASK_TYPE_IOREAD. This simply indicates that a normal request type
650 * (i.e. non-raw frame) is being utilized to perform task management. -#
651 * control_frame == 1. This ensures that the proper endianess is set so
652 * that the bytes are transmitted in the right order for a task frame.
653 * @this_request: This parameter specifies the task request object being
657 static void scu_ssp_task_request_construct_task_context(
658 struct scic_sds_request *this_request)
660 struct scu_task_context *task_context;
662 task_context = scic_sds_request_get_task_context(this_request);
664 scu_ssp_reqeust_construct_task_context(this_request, task_context);
666 task_context->control_frame = 1;
667 task_context->priority = SCU_TASK_PRIORITY_HIGH;
668 task_context->task_type = SCU_TASK_TYPE_RAW_FRAME;
669 task_context->transfer_length_bytes = 0;
670 task_context->type.ssp.frame_type = SCI_SAS_TASK_FRAME;
671 task_context->ssp_command_iu_length = sizeof(struct sci_ssp_task_iu) / sizeof(u32);
676 * This method constructs the SSP Command IU data for this ssp passthrough
677 * comand request object.
678 * @this_request: This parameter specifies the request object for which the SSP
679 * command information unit is being built.
681 * enum sci_status, returns invalid parameter is cdb > 16
686 * This method constructs the SATA request object.
695 static enum sci_status scic_io_request_construct_sata(struct scic_sds_request *sci_req,
697 enum dma_data_direction dir,
700 enum sci_status status = SCI_SUCCESS;
703 case SAT_PROTOCOL_PIO_DATA_IN:
704 case SAT_PROTOCOL_PIO_DATA_OUT:
705 status = scic_sds_stp_pio_request_construct(sci_req, proto, copy);
708 case SAT_PROTOCOL_UDMA_DATA_IN:
709 case SAT_PROTOCOL_UDMA_DATA_OUT:
710 status = scic_sds_stp_udma_request_construct(sci_req, len, dir);
713 case SAT_PROTOCOL_ATA_HARD_RESET:
714 case SAT_PROTOCOL_SOFT_RESET:
715 status = scic_sds_stp_soft_reset_request_construct(sci_req);
718 case SAT_PROTOCOL_NON_DATA:
719 status = scic_sds_stp_non_data_request_construct(sci_req);
722 case SAT_PROTOCOL_FPDMA:
723 status = scic_sds_stp_ncq_request_construct(sci_req, len, dir);
726 #if !defined(DISABLE_ATAPI)
727 case SAT_PROTOCOL_PACKET_NON_DATA:
728 case SAT_PROTOCOL_PACKET_DMA_DATA_IN:
729 case SAT_PROTOCOL_PACKET_DMA_DATA_OUT:
730 case SAT_PROTOCOL_PACKET_PIO_DATA_IN:
731 case SAT_PROTOCOL_PACKET_PIO_DATA_OUT:
732 status = scic_sds_stp_packet_request_construct(sci_req);
736 case SAT_PROTOCOL_DMA_QUEUED:
737 case SAT_PROTOCOL_DMA:
738 case SAT_PROTOCOL_DEVICE_DIAGNOSTIC:
739 case SAT_PROTOCOL_DEVICE_RESET:
740 case SAT_PROTOCOL_RETURN_RESPONSE_INFO:
742 dev_err(scic_to_dev(sci_req->owning_controller),
743 "%s: SCIC IO Request 0x%p received un-handled "
745 __func__, sci_req, proto);
747 status = SCI_FAILURE;
755 * ****************************************************************************
756 * * SCIC Interface Implementation
757 * **************************************************************************** */
762 /* --------------------------------------------------------------------------- */
764 u32 scic_io_request_get_object_size(void)
766 u32 ssp_request_size;
767 u32 stp_request_size;
768 u32 smp_request_size;
770 ssp_request_size = scic_sds_ssp_request_get_object_size();
771 stp_request_size = scic_sds_stp_request_get_object_size();
772 smp_request_size = scic_sds_smp_request_get_object_size();
774 return max(ssp_request_size, max(stp_request_size, smp_request_size));
777 /* --------------------------------------------------------------------------- */
780 /* --------------------------------------------------------------------------- */
783 /* --------------------------------------------------------------------------- */
786 /* --------------------------------------------------------------------------- */
788 enum sci_status scic_io_request_construct(
789 struct scic_sds_controller *scic_controller,
790 struct scic_sds_remote_device *scic_remote_device,
792 void *user_io_request_object,
793 void *scic_io_request_memory,
794 struct scic_sds_request **new_scic_io_request_handle)
796 enum sci_status status = SCI_SUCCESS;
797 struct scic_sds_request *this_request;
798 struct smp_discover_response_protocols device_protocol;
800 this_request = (struct scic_sds_request *)scic_io_request_memory;
802 /* Build the common part of the request */
803 scic_sds_general_request_construct(
804 (struct scic_sds_controller *)scic_controller,
805 (struct scic_sds_remote_device *)scic_remote_device,
807 user_io_request_object,
812 scic_sds_remote_device_get_index((struct scic_sds_remote_device *)scic_remote_device)
813 == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX
815 return SCI_FAILURE_INVALID_REMOTE_DEVICE;
818 scic_remote_device_get_protocols(scic_remote_device, &device_protocol);
820 if (device_protocol.u.bits.attached_ssp_target) {
821 scic_sds_ssp_io_request_assign_buffers(this_request);
822 } else if (device_protocol.u.bits.attached_stp_target) {
823 scic_sds_stp_request_assign_buffers(this_request);
824 memset(this_request->command_buffer, 0, sizeof(struct sata_fis_reg_h2d));
825 } else if (device_protocol.u.bits.attached_smp_target) {
826 scic_sds_smp_request_assign_buffers(this_request);
827 memset(this_request->command_buffer, 0, sizeof(struct smp_request));
829 status = SCI_FAILURE_UNSUPPORTED_PROTOCOL;
832 if (status == SCI_SUCCESS) {
834 this_request->task_context_buffer,
836 SCI_FIELD_OFFSET(struct scu_task_context, sgl_pair_ab)
838 *new_scic_io_request_handle = scic_io_request_memory;
844 /* --------------------------------------------------------------------------- */
847 enum sci_status scic_task_request_construct(
848 struct scic_sds_controller *controller,
849 struct scic_sds_remote_device *remote_device,
851 void *user_io_request_object,
852 void *scic_task_request_memory,
853 struct scic_sds_request **new_scic_task_request_handle)
855 enum sci_status status = SCI_SUCCESS;
856 struct scic_sds_request *this_request = (struct scic_sds_request *)
857 scic_task_request_memory;
858 struct smp_discover_response_protocols device_protocol;
860 /* Build the common part of the request */
861 scic_sds_general_request_construct(
862 (struct scic_sds_controller *)controller,
863 (struct scic_sds_remote_device *)remote_device,
865 user_io_request_object,
869 scic_remote_device_get_protocols(remote_device, &device_protocol);
871 if (device_protocol.u.bits.attached_ssp_target) {
872 scic_sds_ssp_task_request_assign_buffers(this_request);
874 this_request->has_started_substate_machine = true;
876 /* Construct the started sub-state machine. */
877 sci_base_state_machine_construct(
878 &this_request->started_substate_machine,
879 &this_request->parent.parent,
880 scic_sds_io_request_started_task_mgmt_substate_table,
881 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_COMPLETION
883 } else if (device_protocol.u.bits.attached_stp_target) {
884 scic_sds_stp_request_assign_buffers(this_request);
886 status = SCI_FAILURE_UNSUPPORTED_PROTOCOL;
889 if (status == SCI_SUCCESS) {
890 this_request->is_task_management_request = true;
891 memset(this_request->task_context_buffer, 0x00, sizeof(struct scu_task_context));
892 *new_scic_task_request_handle = scic_task_request_memory;
899 enum sci_status scic_io_request_construct_basic_ssp(
900 struct scic_sds_request *sci_req)
904 sci_req->protocol = SCIC_SSP_PROTOCOL;
906 os_handle = scic_sds_request_get_user_request(sci_req);
908 scu_ssp_io_request_construct_task_context(
910 scic_cb_io_request_get_data_direction(os_handle),
911 scic_cb_io_request_get_transfer_length(os_handle)
915 scic_sds_io_request_build_ssp_command_iu(sci_req);
917 sci_base_state_machine_change_state(
918 &sci_req->parent.state_machine,
919 SCI_BASE_REQUEST_STATE_CONSTRUCTED
926 enum sci_status scic_task_request_construct_ssp(
927 struct scic_sds_request *sci_req)
929 /* Construct the SSP Task SCU Task Context */
930 scu_ssp_task_request_construct_task_context(sci_req);
932 /* Fill in the SSP Task IU */
933 scic_sds_task_request_build_ssp_task_iu(sci_req);
935 sci_base_state_machine_change_state(
936 &sci_req->parent.state_machine,
937 SCI_BASE_REQUEST_STATE_CONSTRUCTED
944 enum sci_status scic_io_request_construct_basic_sata(struct scic_sds_request *sci_req)
946 enum sci_status status;
947 struct scic_sds_stp_request *stp_req;
950 enum dma_data_direction dir;
953 stp_req = container_of(sci_req, typeof(*stp_req), parent);
955 sci_req->protocol = SCIC_STP_PROTOCOL;
957 len = scic_cb_io_request_get_transfer_length(sci_req->user_request);
958 dir = scic_cb_io_request_get_data_direction(sci_req->user_request);
959 proto = scic_cb_request_get_sat_protocol(sci_req->user_request);
960 copy = scic_cb_io_request_do_copy_rx_frames(stp_req->parent.user_request);
962 status = scic_io_request_construct_sata(sci_req, proto, len, dir, copy);
964 if (status == SCI_SUCCESS)
965 sci_base_state_machine_change_state(
966 &sci_req->parent.state_machine,
967 SCI_BASE_REQUEST_STATE_CONSTRUCTED
974 enum sci_status scic_task_request_construct_sata(
975 struct scic_sds_request *sci_req)
977 enum sci_status status;
978 u8 sat_protocol = scic_cb_request_get_sat_protocol(sci_req->user_request);
980 switch (sat_protocol) {
981 case SAT_PROTOCOL_ATA_HARD_RESET:
982 case SAT_PROTOCOL_SOFT_RESET:
983 status = scic_sds_stp_soft_reset_request_construct(sci_req);
987 dev_err(scic_to_dev(sci_req->owning_controller),
988 "%s: SCIC IO Request 0x%p received un-handled SAT "
994 status = SCI_FAILURE;
998 if (status == SCI_SUCCESS)
999 sci_base_state_machine_change_state(
1000 &sci_req->parent.state_machine,
1001 SCI_BASE_REQUEST_STATE_CONSTRUCTED
1008 u16 scic_io_request_get_io_tag(
1009 struct scic_sds_request *sci_req)
1011 return sci_req->io_tag;
1015 u32 scic_request_get_controller_status(
1016 struct scic_sds_request *sci_req)
1018 return sci_req->scu_status;
1022 void *scic_io_request_get_command_iu_address(
1023 struct scic_sds_request *sci_req)
1025 return sci_req->command_buffer;
1029 void *scic_io_request_get_response_iu_address(
1030 struct scic_sds_request *sci_req)
1032 return sci_req->response_buffer;
1036 #define SCU_TASK_CONTEXT_SRAM 0x200000
1037 u32 scic_io_request_get_number_of_bytes_transferred(
1038 struct scic_sds_request *scic_sds_request)
1042 if (SMU_AMR_READ(scic_sds_request->owning_controller) == 0) {
1044 * get the bytes of data from the Address == BAR1 + 20002Ch + (256*TCi) where
1045 * BAR1 is the scu_registers
1046 * 0x20002C = 0x200000 + 0x2c
1047 * = start of task context SRAM + offset of (type.ssp.data_offset)
1048 * TCi is the io_tag of struct scic_sds_request */
1049 ret_val = scic_sds_pci_read_scu_dword(
1050 scic_sds_request->owning_controller,
1052 (u8 *)scic_sds_request->owning_controller->scu_registers +
1053 (SCU_TASK_CONTEXT_SRAM + SCI_FIELD_OFFSET(struct scu_task_context, type.ssp.data_offset)) +
1054 ((sizeof(struct scu_task_context)) * scic_sds_io_tag_get_index(scic_sds_request->io_tag))
1064 * ****************************************************************************
1065 * * SCIC SDS Interface Implementation
1066 * **************************************************************************** */
1070 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
1071 * operation is to be executed.
1073 * This method invokes the base state start request handler for the
1074 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
1076 enum sci_status scic_sds_request_start(
1077 struct scic_sds_request *this_request)
1080 this_request->device_sequence
1081 == scic_sds_remote_device_get_sequence(this_request->target_device)
1083 return this_request->state_handlers->parent.start_handler(
1084 &this_request->parent
1093 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
1094 * operation is to be executed.
1096 * This method invokes the base state terminate request handber for the
1097 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
1099 enum sci_status scic_sds_io_request_terminate(
1100 struct scic_sds_request *this_request)
1102 return this_request->state_handlers->parent.abort_handler(
1103 &this_request->parent);
1108 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
1109 * operation is to be executed.
1111 * This method invokes the base state request completion handler for the
1112 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
1114 enum sci_status scic_sds_io_request_complete(
1115 struct scic_sds_request *this_request)
1117 return this_request->state_handlers->parent.complete_handler(
1118 &this_request->parent);
1123 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
1124 * operation is to be executed.
1125 * @event_code: The event code returned by the hardware for the task reqeust.
1127 * This method invokes the core state handler for the SCIC_SDS_IO_REQUEST_T
1128 * object. enum sci_status
1130 enum sci_status scic_sds_io_request_event_handler(
1131 struct scic_sds_request *this_request,
1134 return this_request->state_handlers->event_handler(this_request, event_code);
1139 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
1140 * operation is to be executed.
1141 * @frame_index: The frame index returned by the hardware for the reqeust
1144 * This method invokes the core state frame handler for the
1145 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
1147 enum sci_status scic_sds_io_request_frame_handler(
1148 struct scic_sds_request *this_request,
1151 return this_request->state_handlers->frame_handler(this_request, frame_index);
1156 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the task start
1157 * operation is to be executed.
1159 * This method invokes the core state task complete handler for the
1160 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
1164 * ****************************************************************************
1165 * * SCIC SDS PROTECTED METHODS
1166 * **************************************************************************** */
1169 * This method copies response data for requests returning response data
1170 * instead of sense data.
1171 * @this_request: This parameter specifies the request object for which to copy
1172 * the response data.
1175 void scic_sds_io_request_copy_response(
1176 struct scic_sds_request *this_request)
1178 void *response_buffer;
1179 u32 user_response_length;
1180 u32 core_response_length;
1181 struct sci_ssp_response_iu *ssp_response;
1183 ssp_response = (struct sci_ssp_response_iu *)this_request->response_buffer;
1185 response_buffer = scic_cb_ssp_task_request_get_response_data_address(
1186 this_request->user_request
1189 user_response_length = scic_cb_ssp_task_request_get_response_data_length(
1190 this_request->user_request
1193 core_response_length = sci_ssp_get_response_data_length(
1194 ssp_response->response_data_length
1197 user_response_length = min(user_response_length, core_response_length);
1199 memcpy(response_buffer, ssp_response->data, user_response_length);
1203 * *****************************************************************************
1204 * * DEFAULT STATE HANDLERS
1205 * ***************************************************************************** */
1208 * scic_sds_request_default_start_handler() -
1209 * @request: This is the struct sci_base_request object that is cast to the
1210 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1212 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1213 * object receives a scic_sds_request_start() request. The default action is
1214 * to log a warning and return a failure status. enum sci_status
1215 * SCI_FAILURE_INVALID_STATE
1217 enum sci_status scic_sds_request_default_start_handler(
1218 struct sci_base_request *request)
1220 struct scic_sds_request *scic_request =
1221 (struct scic_sds_request *)request;
1223 dev_warn(scic_to_dev(scic_request->owning_controller),
1224 "%s: SCIC IO Request requested to start while in wrong "
1227 sci_base_state_machine_get_state(
1228 &((struct scic_sds_request *)request)->parent.state_machine));
1230 return SCI_FAILURE_INVALID_STATE;
1233 static enum sci_status scic_sds_request_default_abort_handler(
1234 struct sci_base_request *request)
1236 struct scic_sds_request *scic_request =
1237 (struct scic_sds_request *)request;
1239 dev_warn(scic_to_dev(scic_request->owning_controller),
1240 "%s: SCIC IO Request requested to abort while in wrong "
1243 sci_base_state_machine_get_state(
1244 &((struct scic_sds_request *)request)->parent.state_machine));
1246 return SCI_FAILURE_INVALID_STATE;
1250 * scic_sds_request_default_complete_handler() -
1251 * @request: This is the struct sci_base_request object that is cast to the
1252 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1254 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1255 * object receives a scic_sds_request_complete() request. The default action
1256 * is to log a warning and return a failure status. enum sci_status
1257 * SCI_FAILURE_INVALID_STATE
1259 enum sci_status scic_sds_request_default_complete_handler(
1260 struct sci_base_request *request)
1262 struct scic_sds_request *scic_request =
1263 (struct scic_sds_request *)request;
1265 dev_warn(scic_to_dev(scic_request->owning_controller),
1266 "%s: SCIC IO Request requested to complete while in wrong "
1269 sci_base_state_machine_get_state(
1270 &((struct scic_sds_request *)request)->parent.state_machine));
1272 return SCI_FAILURE_INVALID_STATE;
1276 * scic_sds_request_default_destruct_handler() -
1277 * @request: This is the struct sci_base_request object that is cast to the
1278 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1280 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1281 * object receives a scic_sds_request_complete() request. The default action
1282 * is to log a warning and return a failure status. enum sci_status
1283 * SCI_FAILURE_INVALID_STATE
1285 enum sci_status scic_sds_request_default_destruct_handler(
1286 struct sci_base_request *request)
1288 struct scic_sds_request *scic_request =
1289 (struct scic_sds_request *)request;
1291 dev_warn(scic_to_dev(scic_request->owning_controller),
1292 "%s: SCIC IO Request requested to destroy while in wrong "
1295 sci_base_state_machine_get_state(
1296 &((struct scic_sds_request *)request)->parent.state_machine));
1298 return SCI_FAILURE_INVALID_STATE;
1302 * scic_sds_request_default_tc_completion_handler() -
1303 * @request: This is the struct sci_base_request object that is cast to the
1304 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1306 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1307 * object receives a scic_sds_task_request_complete() request. The default
1308 * action is to log a warning and return a failure status. enum sci_status
1309 * SCI_FAILURE_INVALID_STATE
1311 enum sci_status scic_sds_request_default_tc_completion_handler(
1312 struct scic_sds_request *this_request,
1313 u32 completion_code)
1315 dev_warn(scic_to_dev(this_request->owning_controller),
1316 "%s: SCIC IO Request given task completion notification %x "
1317 "while in wrong state %d\n",
1320 sci_base_state_machine_get_state(
1321 &this_request->parent.state_machine));
1323 return SCI_FAILURE_INVALID_STATE;
1328 * scic_sds_request_default_event_handler() -
1329 * @request: This is the struct sci_base_request object that is cast to the
1330 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1332 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1333 * object receives a scic_sds_request_event_handler() request. The default
1334 * action is to log a warning and return a failure status. enum sci_status
1335 * SCI_FAILURE_INVALID_STATE
1337 enum sci_status scic_sds_request_default_event_handler(
1338 struct scic_sds_request *this_request,
1341 dev_warn(scic_to_dev(this_request->owning_controller),
1342 "%s: SCIC IO Request given event code notification %x while "
1343 "in wrong state %d\n",
1346 sci_base_state_machine_get_state(
1347 &this_request->parent.state_machine));
1349 return SCI_FAILURE_INVALID_STATE;
1353 * scic_sds_request_default_frame_handler() -
1354 * @request: This is the struct sci_base_request object that is cast to the
1355 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1357 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1358 * object receives a scic_sds_request_event_handler() request. The default
1359 * action is to log a warning and return a failure status. enum sci_status
1360 * SCI_FAILURE_INVALID_STATE
1362 enum sci_status scic_sds_request_default_frame_handler(
1363 struct scic_sds_request *this_request,
1366 dev_warn(scic_to_dev(this_request->owning_controller),
1367 "%s: SCIC IO Request given unexpected frame %x while in "
1371 sci_base_state_machine_get_state(
1372 &this_request->parent.state_machine));
1374 scic_sds_controller_release_frame(
1375 this_request->owning_controller, frame_index);
1377 return SCI_FAILURE_INVALID_STATE;
1381 * *****************************************************************************
1382 * * CONSTRUCTED STATE HANDLERS
1383 * ***************************************************************************** */
1386 * scic_sds_request_constructed_state_start_handler() -
1387 * @request: This is the struct sci_base_request object that is cast to the
1388 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1390 * This method implements the action taken when a constructed
1391 * SCIC_SDS_IO_REQUEST_T object receives a scic_sds_request_start() request.
1392 * This method will, if necessary, allocate a TCi for the io request object and
1393 * then will, if necessary, copy the constructed TC data into the actual TC
1394 * buffer. If everything is successful the post context field is updated with
1395 * the TCi so the controller can post the request to the hardware. enum sci_status
1396 * SCI_SUCCESS SCI_FAILURE_INSUFFICIENT_RESOURCES
1398 static enum sci_status scic_sds_request_constructed_state_start_handler(
1399 struct sci_base_request *request)
1401 struct scu_task_context *task_context;
1402 struct scic_sds_request *this_request = (struct scic_sds_request *)request;
1404 if (this_request->io_tag == SCI_CONTROLLER_INVALID_IO_TAG) {
1405 this_request->io_tag =
1406 scic_controller_allocate_io_tag(this_request->owning_controller);
1409 /* Record the IO Tag in the request */
1410 if (this_request->io_tag != SCI_CONTROLLER_INVALID_IO_TAG) {
1411 task_context = this_request->task_context_buffer;
1413 task_context->task_index = scic_sds_io_tag_get_index(this_request->io_tag);
1415 switch (task_context->protocol_type) {
1416 case SCU_TASK_CONTEXT_PROTOCOL_SMP:
1417 case SCU_TASK_CONTEXT_PROTOCOL_SSP:
1419 task_context->type.ssp.tag = this_request->io_tag;
1420 task_context->type.ssp.target_port_transfer_tag = 0xFFFF;
1423 case SCU_TASK_CONTEXT_PROTOCOL_STP:
1426 * task_context->type.stp.ncq_tag = this_request->ncq_tag; */
1429 case SCU_TASK_CONTEXT_PROTOCOL_NONE:
1430 /* / @todo When do we set no protocol type? */
1434 /* This should never happen since we build the IO requests */
1439 * Check to see if we need to copy the task context buffer
1440 * or have been building into the task context buffer */
1441 if (this_request->was_tag_assigned_by_user == false) {
1442 scic_sds_controller_copy_task_context(
1443 this_request->owning_controller, this_request
1447 /* Add to the post_context the io tag value */
1448 this_request->post_context |= scic_sds_io_tag_get_index(this_request->io_tag);
1450 /* Everything is good go ahead and change state */
1451 sci_base_state_machine_change_state(
1452 &this_request->parent.state_machine,
1453 SCI_BASE_REQUEST_STATE_STARTED
1459 return SCI_FAILURE_INSUFFICIENT_RESOURCES;
1463 * scic_sds_request_constructed_state_abort_handler() -
1464 * @request: This is the struct sci_base_request object that is cast to the
1465 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1467 * This method implements the action to be taken when an SCIC_SDS_IO_REQUEST_T
1468 * object receives a scic_sds_request_terminate() request. Since the request
1469 * has not yet been posted to the hardware the request transitions to the
1470 * completed state. enum sci_status SCI_SUCCESS
1472 static enum sci_status scic_sds_request_constructed_state_abort_handler(
1473 struct sci_base_request *request)
1475 struct scic_sds_request *this_request = (struct scic_sds_request *)request;
1478 * This request has been terminated by the user make sure that the correct
1479 * status code is returned */
1480 scic_sds_request_set_status(
1482 SCU_TASK_DONE_TASK_ABORT,
1483 SCI_FAILURE_IO_TERMINATED
1486 sci_base_state_machine_change_state(
1487 &this_request->parent.state_machine,
1488 SCI_BASE_REQUEST_STATE_COMPLETED
1495 * *****************************************************************************
1496 * * STARTED STATE HANDLERS
1497 * ***************************************************************************** */
1500 * scic_sds_request_started_state_abort_handler() -
1501 * @request: This is the struct sci_base_request object that is cast to the
1502 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1504 * This method implements the action to be taken when an SCIC_SDS_IO_REQUEST_T
1505 * object receives a scic_sds_request_terminate() request. Since the request
1506 * has been posted to the hardware the io request state is changed to the
1507 * aborting state. enum sci_status SCI_SUCCESS
1509 enum sci_status scic_sds_request_started_state_abort_handler(
1510 struct sci_base_request *request)
1512 struct scic_sds_request *this_request = (struct scic_sds_request *)request;
1514 if (this_request->has_started_substate_machine) {
1515 sci_base_state_machine_stop(&this_request->started_substate_machine);
1518 sci_base_state_machine_change_state(
1519 &this_request->parent.state_machine,
1520 SCI_BASE_REQUEST_STATE_ABORTING
1527 * scic_sds_request_started_state_tc_completion_handler() - This method process
1528 * TC (task context) completions for normal IO request (i.e. Task/Abort
1529 * Completions of type 0). This method will update the
1530 * SCIC_SDS_IO_REQUEST_T::status field.
1531 * @this_request: This parameter specifies the request for which a completion
1533 * @completion_code: This parameter specifies the completion code received from
1537 enum sci_status scic_sds_request_started_state_tc_completion_handler(
1538 struct scic_sds_request *this_request,
1539 u32 completion_code)
1542 struct sci_ssp_response_iu *response_buffer;
1545 * @todo Any SDMA return code of other than 0 is bad
1546 * decode 0x003C0000 to determine SDMA status
1548 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
1549 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
1550 scic_sds_request_set_status(
1551 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1555 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_EARLY_RESP):
1558 * There are times when the SCU hardware will return an early response
1559 * because the io request specified more data than is returned by the
1560 * target device (mode pages, inquiry data, etc.). We must check the
1561 * response stats to see if this is truly a failed request or a good
1562 * request that just got completed early. */
1563 struct sci_ssp_response_iu *response = (struct sci_ssp_response_iu *)
1564 this_request->response_buffer;
1565 scic_word_copy_with_swap(
1566 this_request->response_buffer,
1567 this_request->response_buffer,
1568 sizeof(struct sci_ssp_response_iu) / sizeof(u32)
1571 if (response->status == 0) {
1572 scic_sds_request_set_status(
1573 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS_IO_DONE_EARLY
1576 scic_sds_request_set_status(
1578 SCU_TASK_DONE_CHECK_RESPONSE,
1579 SCI_FAILURE_IO_RESPONSE_VALID
1585 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CHECK_RESPONSE):
1586 scic_word_copy_with_swap(
1587 this_request->response_buffer,
1588 this_request->response_buffer,
1589 sizeof(struct sci_ssp_response_iu) / sizeof(u32)
1592 scic_sds_request_set_status(
1594 SCU_TASK_DONE_CHECK_RESPONSE,
1595 SCI_FAILURE_IO_RESPONSE_VALID
1599 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_RESP_LEN_ERR):
1601 * / @todo With TASK_DONE_RESP_LEN_ERR is the response frame guaranteed
1602 * / to be received before this completion status is posted? */
1604 (struct sci_ssp_response_iu *)this_request->response_buffer;
1606 response_buffer->data_present & SCI_SSP_RESPONSE_IU_DATA_PRESENT_MASK;
1608 if ((data_present == 0x01) || (data_present == 0x02)) {
1609 scic_sds_request_set_status(
1611 SCU_TASK_DONE_CHECK_RESPONSE,
1612 SCI_FAILURE_IO_RESPONSE_VALID
1615 scic_sds_request_set_status(
1616 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1621 /* only stp device gets suspended. */
1622 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_ACK_NAK_TO):
1623 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_LL_PERR):
1624 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_NAK_ERR):
1625 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_DATA_LEN_ERR):
1626 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_LL_ABORT_ERR):
1627 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_XR_WD_LEN):
1628 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_MAX_PLD_ERR):
1629 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_RESP):
1630 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_SDBFIS):
1631 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR):
1632 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDB_ERR):
1633 if (this_request->protocol == SCIC_STP_PROTOCOL) {
1634 scic_sds_request_set_status(
1636 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT,
1637 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED
1640 scic_sds_request_set_status(
1642 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT,
1643 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1648 /* both stp/ssp device gets suspended */
1649 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_LF_ERR):
1650 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_WRONG_DESTINATION):
1651 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_RESERVED_ABANDON_1):
1652 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_RESERVED_ABANDON_2):
1653 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_RESERVED_ABANDON_3):
1654 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_BAD_DESTINATION):
1655 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_ZONE_VIOLATION):
1656 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_STP_RESOURCES_BUSY):
1657 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_PROTOCOL_NOT_SUPPORTED):
1658 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_CONNECTION_RATE_NOT_SUPPORTED):
1659 scic_sds_request_set_status(
1661 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT,
1662 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED
1666 /* neither ssp nor stp gets suspended. */
1667 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_NAK_CMD_ERR):
1668 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_XR):
1669 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_XR_IU_LEN_ERR):
1670 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDMA_ERR):
1671 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_OFFSET_ERR):
1672 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_EXCESS_DATA):
1673 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SMP_RESP_TO_ERR):
1674 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SMP_UFI_ERR):
1675 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SMP_FRM_TYPE_ERR):
1676 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SMP_LL_RX_ERR):
1677 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_DATA):
1678 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_OPEN_FAIL):
1679 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_VIIT_ENTRY_NV):
1680 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_IIT_ENTRY_NV):
1681 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_RNCNV_OUTBOUND):
1683 scic_sds_request_set_status(
1685 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT,
1686 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1692 * @todo This is probably wrong for ACK/NAK timeout conditions
1695 /* In all cases we will treat this as the completion of the IO request. */
1696 sci_base_state_machine_change_state(
1697 &this_request->parent.state_machine,
1698 SCI_BASE_REQUEST_STATE_COMPLETED
1705 * scic_sds_request_started_state_frame_handler() -
1706 * @request: This is the struct sci_base_request object that is cast to the
1707 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1708 * @frame_index: This is the index of the unsolicited frame to be processed.
1710 * This method implements the action to be taken when an SCIC_SDS_IO_REQUEST_T
1711 * object receives a scic_sds_request_frame_handler() request. This method
1712 * first determines the frame type received. If this is a response frame then
1713 * the response data is copied to the io request response buffer for processing
1714 * at completion time. If the frame type is not a response buffer an error is
1715 * logged. enum sci_status SCI_SUCCESS SCI_FAILURE_INVALID_PARAMETER_VALUE
1717 static enum sci_status scic_sds_request_started_state_frame_handler(
1718 struct scic_sds_request *this_request,
1721 enum sci_status status;
1722 struct sci_ssp_frame_header *frame_header;
1724 /* / @todo If this is a response frame we must record that we received it */
1725 status = scic_sds_unsolicited_frame_control_get_header(
1726 &(scic_sds_request_get_controller(this_request)->uf_control),
1728 (void **)&frame_header
1731 if (frame_header->frame_type == SCI_SAS_RESPONSE_FRAME) {
1732 struct sci_ssp_response_iu *response_buffer;
1734 status = scic_sds_unsolicited_frame_control_get_buffer(
1735 &(scic_sds_request_get_controller(this_request)->uf_control),
1737 (void **)&response_buffer
1740 scic_word_copy_with_swap(
1741 this_request->response_buffer,
1742 (u32 *)response_buffer,
1743 sizeof(struct sci_ssp_response_iu)
1746 response_buffer = (struct sci_ssp_response_iu *)this_request->response_buffer;
1748 if ((response_buffer->data_present == 0x01) ||
1749 (response_buffer->data_present == 0x02)) {
1750 scic_sds_request_set_status(
1752 SCU_TASK_DONE_CHECK_RESPONSE,
1753 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1756 scic_sds_request_set_status(
1757 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1760 /* This was not a response frame why did it get forwarded? */
1761 dev_err(scic_to_dev(this_request->owning_controller),
1762 "%s: SCIC IO Request 0x%p received unexpected "
1763 "frame %d type 0x%02x\n",
1767 frame_header->frame_type);
1770 * In any case we are done with this frame buffer return it to the
1772 scic_sds_controller_release_frame(
1773 this_request->owning_controller, frame_index
1780 * *****************************************************************************
1781 * * COMPLETED STATE HANDLERS
1782 * ***************************************************************************** */
1786 * scic_sds_request_completed_state_complete_handler() -
1787 * @request: This is the struct sci_base_request object that is cast to the
1788 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1790 * This method implements the action to be taken when an SCIC_SDS_IO_REQUEST_T
1791 * object receives a scic_sds_request_complete() request. This method frees up
1792 * any io request resources that have been allocated and transitions the
1793 * request to its final state. Consider stopping the state machine instead of
1794 * transitioning to the final state? enum sci_status SCI_SUCCESS
1796 static enum sci_status scic_sds_request_completed_state_complete_handler(
1797 struct sci_base_request *request)
1799 struct scic_sds_request *this_request = (struct scic_sds_request *)request;
1801 if (this_request->was_tag_assigned_by_user != true) {
1802 scic_controller_free_io_tag(
1803 this_request->owning_controller, this_request->io_tag
1807 if (this_request->saved_rx_frame_index != SCU_INVALID_FRAME_INDEX) {
1808 scic_sds_controller_release_frame(
1809 this_request->owning_controller, this_request->saved_rx_frame_index);
1812 sci_base_state_machine_change_state(
1813 &this_request->parent.state_machine,
1814 SCI_BASE_REQUEST_STATE_FINAL
1821 * *****************************************************************************
1822 * * ABORTING STATE HANDLERS
1823 * ***************************************************************************** */
1826 * scic_sds_request_aborting_state_abort_handler() -
1827 * @request: This is the struct sci_base_request object that is cast to the
1828 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1830 * This method implements the action to be taken when an SCIC_SDS_IO_REQUEST_T
1831 * object receives a scic_sds_request_terminate() request. This method is the
1832 * io request aborting state abort handlers. On receipt of a multiple
1833 * terminate requests the io request will transition to the completed state.
1834 * This should not happen in normal operation. enum sci_status SCI_SUCCESS
1836 static enum sci_status scic_sds_request_aborting_state_abort_handler(
1837 struct sci_base_request *request)
1839 struct scic_sds_request *this_request = (struct scic_sds_request *)request;
1841 sci_base_state_machine_change_state(
1842 &this_request->parent.state_machine,
1843 SCI_BASE_REQUEST_STATE_COMPLETED
1850 * scic_sds_request_aborting_state_tc_completion_handler() -
1851 * @request: This is the struct sci_base_request object that is cast to the
1852 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1854 * This method implements the action to be taken when an SCIC_SDS_IO_REQUEST_T
1855 * object receives a scic_sds_request_task_completion() request. This method
1856 * decodes the completion type waiting for the abort task complete
1857 * notification. When the abort task complete is received the io request
1858 * transitions to the completed state. enum sci_status SCI_SUCCESS
1860 static enum sci_status scic_sds_request_aborting_state_tc_completion_handler(
1861 struct scic_sds_request *this_request,
1862 u32 completion_code)
1864 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
1865 case (SCU_TASK_DONE_GOOD << SCU_COMPLETION_TL_STATUS_SHIFT):
1866 case (SCU_TASK_DONE_TASK_ABORT << SCU_COMPLETION_TL_STATUS_SHIFT):
1867 scic_sds_request_set_status(
1868 this_request, SCU_TASK_DONE_TASK_ABORT, SCI_FAILURE_IO_TERMINATED
1871 sci_base_state_machine_change_state(
1872 &this_request->parent.state_machine,
1873 SCI_BASE_REQUEST_STATE_COMPLETED
1879 * Unless we get some strange error wait for the task abort to complete
1880 * TODO: Should there be a state change for this completion? */
1888 * scic_sds_request_aborting_state_frame_handler() -
1889 * @request: This is the struct sci_base_request object that is cast to the
1890 * SCIC_SDS_IO_REQUEST_T object for which the start operation is requested.
1892 * This method implements the action to be taken when an SCIC_SDS_IO_REQUEST_T
1893 * object receives a scic_sds_request_frame_handler() request. This method
1894 * discards the unsolicited frame since we are waiting for the abort task
1895 * completion. enum sci_status SCI_SUCCESS
1897 static enum sci_status scic_sds_request_aborting_state_frame_handler(
1898 struct scic_sds_request *this_request,
1901 /* TODO: Is it even possible to get an unsolicited frame in the aborting state? */
1903 scic_sds_controller_release_frame(
1904 this_request->owning_controller, frame_index);
1909 /* --------------------------------------------------------------------------- */
1911 const struct scic_sds_io_request_state_handler scic_sds_request_state_handler_table[] = {
1912 [SCI_BASE_REQUEST_STATE_INITIAL] = {
1913 .parent.start_handler = scic_sds_request_default_start_handler,
1914 .parent.abort_handler = scic_sds_request_default_abort_handler,
1915 .parent.complete_handler = scic_sds_request_default_complete_handler,
1916 .parent.destruct_handler = scic_sds_request_default_destruct_handler,
1917 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1918 .event_handler = scic_sds_request_default_event_handler,
1919 .frame_handler = scic_sds_request_default_frame_handler,
1921 [SCI_BASE_REQUEST_STATE_CONSTRUCTED] = {
1922 .parent.start_handler = scic_sds_request_constructed_state_start_handler,
1923 .parent.abort_handler = scic_sds_request_constructed_state_abort_handler,
1924 .parent.complete_handler = scic_sds_request_default_complete_handler,
1925 .parent.destruct_handler = scic_sds_request_default_destruct_handler,
1926 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1927 .event_handler = scic_sds_request_default_event_handler,
1928 .frame_handler = scic_sds_request_default_frame_handler,
1930 [SCI_BASE_REQUEST_STATE_STARTED] = {
1931 .parent.start_handler = scic_sds_request_default_start_handler,
1932 .parent.abort_handler = scic_sds_request_started_state_abort_handler,
1933 .parent.complete_handler = scic_sds_request_default_complete_handler,
1934 .parent.destruct_handler = scic_sds_request_default_destruct_handler,
1935 .tc_completion_handler = scic_sds_request_started_state_tc_completion_handler,
1936 .event_handler = scic_sds_request_default_event_handler,
1937 .frame_handler = scic_sds_request_started_state_frame_handler,
1939 [SCI_BASE_REQUEST_STATE_COMPLETED] = {
1940 .parent.start_handler = scic_sds_request_default_start_handler,
1941 .parent.abort_handler = scic_sds_request_default_abort_handler,
1942 .parent.complete_handler = scic_sds_request_completed_state_complete_handler,
1943 .parent.destruct_handler = scic_sds_request_default_destruct_handler,
1944 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1945 .event_handler = scic_sds_request_default_event_handler,
1946 .frame_handler = scic_sds_request_default_frame_handler,
1948 [SCI_BASE_REQUEST_STATE_ABORTING] = {
1949 .parent.start_handler = scic_sds_request_default_start_handler,
1950 .parent.abort_handler = scic_sds_request_aborting_state_abort_handler,
1951 .parent.complete_handler = scic_sds_request_default_complete_handler,
1952 .parent.destruct_handler = scic_sds_request_default_destruct_handler,
1953 .tc_completion_handler = scic_sds_request_aborting_state_tc_completion_handler,
1954 .event_handler = scic_sds_request_default_event_handler,
1955 .frame_handler = scic_sds_request_aborting_state_frame_handler,
1957 [SCI_BASE_REQUEST_STATE_FINAL] = {
1958 .parent.start_handler = scic_sds_request_default_start_handler,
1959 .parent.abort_handler = scic_sds_request_default_abort_handler,
1960 .parent.complete_handler = scic_sds_request_default_complete_handler,
1961 .parent.destruct_handler = scic_sds_request_default_destruct_handler,
1962 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1963 .event_handler = scic_sds_request_default_event_handler,
1964 .frame_handler = scic_sds_request_default_frame_handler,
1969 * scic_sds_request_initial_state_enter() -
1970 * @object: This parameter specifies the base object for which the state
1971 * transition is occurring.
1973 * This method implements the actions taken when entering the
1974 * SCI_BASE_REQUEST_STATE_INITIAL state. This state is entered when the initial
1975 * base request is constructed. Entry into the initial state sets all handlers
1976 * for the io request object to their default handlers. none
1978 static void scic_sds_request_initial_state_enter(
1979 struct sci_base_object *object)
1981 struct scic_sds_request *this_request = (struct scic_sds_request *)object;
1985 scic_sds_request_state_handler_table,
1986 SCI_BASE_REQUEST_STATE_INITIAL
1991 * scic_sds_request_constructed_state_enter() -
1992 * @object: The io request object that is to enter the constructed state.
1994 * This method implements the actions taken when entering the
1995 * SCI_BASE_REQUEST_STATE_CONSTRUCTED state. The method sets the state handlers
1996 * for the the constructed state. none
1998 static void scic_sds_request_constructed_state_enter(
1999 struct sci_base_object *object)
2001 struct scic_sds_request *this_request = (struct scic_sds_request *)object;
2005 scic_sds_request_state_handler_table,
2006 SCI_BASE_REQUEST_STATE_CONSTRUCTED
2011 * scic_sds_request_started_state_enter() -
2012 * @object: This parameter specifies the base object for which the state
2013 * transition is occuring. This is cast into a SCIC_SDS_IO_REQUEST object.
2015 * This method implements the actions taken when entering the
2016 * SCI_BASE_REQUEST_STATE_STARTED state. If the io request object type is a
2017 * SCSI Task request we must enter the started substate machine. none
2019 static void scic_sds_request_started_state_enter(
2020 struct sci_base_object *object)
2022 struct scic_sds_request *this_request = (struct scic_sds_request *)object;
2026 scic_sds_request_state_handler_table,
2027 SCI_BASE_REQUEST_STATE_STARTED
2031 * Most of the request state machines have a started substate machine so
2032 * start its execution on the entry to the started state. */
2033 if (this_request->has_started_substate_machine == true)
2034 sci_base_state_machine_start(&this_request->started_substate_machine);
2038 * scic_sds_request_started_state_exit() -
2039 * @object: This parameter specifies the base object for which the state
2040 * transition is occuring. This object is cast into a SCIC_SDS_IO_REQUEST
2043 * This method implements the actions taken when exiting the
2044 * SCI_BASE_REQUEST_STATE_STARTED state. For task requests the action will be
2045 * to stop the started substate machine. none
2047 static void scic_sds_request_started_state_exit(
2048 struct sci_base_object *object)
2050 struct scic_sds_request *this_request = (struct scic_sds_request *)object;
2052 if (this_request->has_started_substate_machine == true)
2053 sci_base_state_machine_stop(&this_request->started_substate_machine);
2057 * scic_sds_request_completed_state_enter() -
2058 * @object: This parameter specifies the base object for which the state
2059 * transition is occuring. This object is cast into a SCIC_SDS_IO_REQUEST
2062 * This method implements the actions taken when entering the
2063 * SCI_BASE_REQUEST_STATE_COMPLETED state. This state is entered when the
2064 * SCIC_SDS_IO_REQUEST has completed. The method will decode the request
2065 * completion status and convert it to an enum sci_status to return in the
2066 * completion callback function. none
2068 static void scic_sds_request_completed_state_enter(
2069 struct sci_base_object *object)
2071 struct scic_sds_request *this_request = (struct scic_sds_request *)object;
2075 scic_sds_request_state_handler_table,
2076 SCI_BASE_REQUEST_STATE_COMPLETED
2079 /* Tell the SCI_USER that the IO request is complete */
2080 if (this_request->is_task_management_request == false) {
2081 isci_event_io_request_complete(
2082 scic_sds_request_get_controller(this_request),
2083 scic_sds_request_get_device(this_request),
2085 this_request->sci_status
2088 isci_event_task_request_complete(
2089 scic_sds_request_get_controller(this_request),
2090 scic_sds_request_get_device(this_request),
2092 this_request->sci_status
2098 * scic_sds_request_aborting_state_enter() -
2099 * @object: This parameter specifies the base object for which the state
2100 * transition is occuring. This object is cast into a SCIC_SDS_IO_REQUEST
2103 * This method implements the actions taken when entering the
2104 * SCI_BASE_REQUEST_STATE_ABORTING state. none
2106 static void scic_sds_request_aborting_state_enter(
2107 struct sci_base_object *object)
2109 struct scic_sds_request *this_request = (struct scic_sds_request *)object;
2111 /* Setting the abort bit in the Task Context is required by the silicon. */
2112 this_request->task_context_buffer->abort = 1;
2116 scic_sds_request_state_handler_table,
2117 SCI_BASE_REQUEST_STATE_ABORTING
2122 * scic_sds_request_final_state_enter() -
2123 * @object: This parameter specifies the base object for which the state
2124 * transition is occuring. This is cast into a SCIC_SDS_IO_REQUEST object.
2126 * This method implements the actions taken when entering the
2127 * SCI_BASE_REQUEST_STATE_FINAL state. The only action required is to put the
2128 * state handlers in place. none
2130 static void scic_sds_request_final_state_enter(
2131 struct sci_base_object *object)
2133 struct scic_sds_request *this_request = (struct scic_sds_request *)object;
2137 scic_sds_request_state_handler_table,
2138 SCI_BASE_REQUEST_STATE_FINAL
2142 /* --------------------------------------------------------------------------- */
2144 const struct sci_base_state scic_sds_request_state_table[] = {
2145 [SCI_BASE_REQUEST_STATE_INITIAL] = {
2146 .enter_state = scic_sds_request_initial_state_enter,
2148 [SCI_BASE_REQUEST_STATE_CONSTRUCTED] = {
2149 .enter_state = scic_sds_request_constructed_state_enter,
2151 [SCI_BASE_REQUEST_STATE_STARTED] = {
2152 .enter_state = scic_sds_request_started_state_enter,
2153 .exit_state = scic_sds_request_started_state_exit
2155 [SCI_BASE_REQUEST_STATE_COMPLETED] = {
2156 .enter_state = scic_sds_request_completed_state_enter,
2158 [SCI_BASE_REQUEST_STATE_ABORTING] = {
2159 .enter_state = scic_sds_request_aborting_state_enter,
2161 [SCI_BASE_REQUEST_STATE_FINAL] = {
2162 .enter_state = scic_sds_request_final_state_enter,