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.
56 #ifndef _SCIC_TASK_REQUEST_H_
57 #define _SCIC_TASK_REQUEST_H_
60 * This file contains the structures and interface methods that can be
61 * referenced and used by the SCI user for to utilize task management
68 #include "sci_types.h"
69 #include "sci_status.h"
71 struct scic_sds_request;
72 struct scic_sds_remote_device;
73 struct scic_sds_controller;
77 * scic_task_request_construct() - This method is called by the SCI user to
78 * construct all SCI Core task management requests, regardless of protocol.
79 * Memory initialization and functionality common to all task request types
80 * is performed in this method.
81 * @scic_controller: the handle to the core controller object for which to
82 * build the task managmement request.
83 * @scic_remote_device: the handle to the core remote device object for which
84 * to build the task management request. passed, then a copy of the request
85 * is built internally. The request will be copied into the actual
86 * controller request memory when the task is allocated internally during
87 * the scic_controller_start_task() method.
88 * @io_tag: This parameter specifies the IO tag to be associated with this
89 * request. If SCI_CONTROLLER_INVALID_IO_TAG is passed, then a copy of the
90 * request is built internally. The request will be copied into the actual
91 * controller request memory when the IO tag is allocated internally during
92 * the scic_controller_start_io() method.
93 * @user_task_request_object: This parameter specifies the user task request to
94 * be utilized during construction. This task pointer will become the
95 * associated object for the core task request object.
96 * @scic_task_request_memory: This parameter specifies the memory location to
97 * be utilized when building the core request.
98 * @new_scic_task_request_handle: This parameter specifies a pointer to the
99 * handle the core will expect in further interactions with the core task
102 * The SCI core implementation will create an association between the user task
103 * request object and the core task request object. Indicate if the controller
104 * successfully built the task request. SCI_SUCCESS This value is returned if
105 * the task request was successfully built.
107 enum sci_status scic_task_request_construct(
108 struct scic_sds_controller *scic_controller,
109 struct scic_sds_remote_device *scic_remote_device,
111 void *user_task_request_object,
112 void *scic_task_request_memory,
113 struct scic_sds_request **new_scic_task_request_handle);
116 * scic_task_request_construct_ssp() - This method is called by the SCI user to
117 * construct all SCI Core SSP task management requests. Memory
118 * initialization and functionality common to all task request types is
119 * performed in this method.
120 * @scic_task_request: This parameter specifies the handle to the core task
121 * request object for which to construct a SATA specific task management
124 * Indicate if the controller successfully built the task request. SCI_SUCCESS
125 * This value is returned if the task request was successfully built.
127 enum sci_status scic_task_request_construct_ssp(
128 struct scic_sds_request *scic_task_request);
131 * scic_task_request_construct_sata() - This method is called by the SCI user
132 * to construct all SCI Core SATA task management requests. Memory
133 * initialization and functionality common to all task request types is
134 * performed in this method.
135 * @scic_task_request_handle: This parameter specifies the handle to the core
136 * task request object for which to construct a SATA specific task
137 * management request.
139 * Indicate if the controller successfully built the task request. SCI_SUCCESS
140 * This value is returned if the task request was successfully built.
142 enum sci_status scic_task_request_construct_sata(
143 struct scic_sds_request *scic_task_request_handle);
147 #endif /* _SCIC_TASK_REQUEST_H_ */