scif_task_request.h revision 331722
1250003Sadrian/*-
2250003Sadrian * This file is provided under a dual BSD/GPLv2 license.  When using or
3250003Sadrian * redistributing this file, you may do so under either license.
4250003Sadrian *
5250003Sadrian * GPL LICENSE SUMMARY
6250003Sadrian *
7250003Sadrian * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8250003Sadrian *
9250003Sadrian * This program is free software; you can redistribute it and/or modify
10250003Sadrian * it under the terms of version 2 of the GNU General Public License as
11250003Sadrian * published by the Free Software Foundation.
12250003Sadrian *
13250003Sadrian * This program is distributed in the hope that it will be useful, but
14250003Sadrian * WITHOUT ANY WARRANTY; without even the implied warranty of
15250003Sadrian * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16250003Sadrian * General Public License for more details.
17250003Sadrian *
18250003Sadrian * You should have received a copy of the GNU General Public License
19250003Sadrian * along with this program; if not, write to the Free Software
20250003Sadrian * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21250003Sadrian * The full GNU General Public License is included in this distribution
22250003Sadrian * in the file called LICENSE.GPL.
23250003Sadrian *
24250003Sadrian * BSD LICENSE
25250003Sadrian *
26250003Sadrian * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27250003Sadrian * All rights reserved.
28250003Sadrian *
29250008Sadrian * Redistribution and use in source and binary forms, with or without
30250008Sadrian * modification, are permitted provided that the following conditions
31250003Sadrian * are met:
32250008Sadrian *
33250003Sadrian *   * Redistributions of source code must retain the above copyright
34250003Sadrian *     notice, this list of conditions and the following disclaimer.
35250003Sadrian *   * Redistributions in binary form must reproduce the above copyright
36250003Sadrian *     notice, this list of conditions and the following disclaimer in
37250003Sadrian *     the documentation and/or other materials provided with the
38250003Sadrian *     distribution.
39250003Sadrian *
40250003Sadrian * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41250003Sadrian * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42250003Sadrian * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43250003Sadrian * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44250003Sadrian * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45250003Sadrian * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46250003Sadrian * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47250008Sadrian * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48250008Sadrian * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49250008Sadrian * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50250008Sadrian * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51250003Sadrian *
52250008Sadrian * $FreeBSD: stable/11/sys/dev/isci/scil/scif_task_request.h 331722 2018-03-29 02:50:57Z eadler $
53250003Sadrian */
54250003Sadrian#ifndef _SCIF_TASK_REQUEST_H_
55250003Sadrian#define _SCIF_TASK_REQUEST_H_
56250003Sadrian
57250003Sadrian/**
58250003Sadrian * @file
59250008Sadrian *
60250003Sadrian * @brief This file contains the structures and interface methods that
61250003Sadrian *        can be referenced and used by the SCI user for the SCI task
62250008Sadrian *        management request object.
63250008Sadrian */
64250003Sadrian
65250003Sadrian#ifdef __cplusplus
66250003Sadrianextern "C" {
67250003Sadrian#endif // __cplusplus
68250003Sadrian
69250003Sadrian#include <dev/isci/scil/sci_types.h>
70250003Sadrian#include <dev/isci/scil/sci_status.h>
71250003Sadrian
72250003Sadrian
73250003Sadrian/**
74250003Sadrian * @brief This method simply returns the size required to construct an SCI
75250003Sadrian *        based task request object (includes core & framework object size).
76250003Sadrian *
77250003Sadrian * @return Retrun the size of the SCI task request object.
78250003Sadrian */
79250003SadrianU32 scif_task_request_get_object_size(
80250008Sadrian   void
81250003Sadrian);
82250003Sadrian
83250003Sadrian/**
84250003Sadrian * @brief This method is called by the SCIF user to construct a task
85250003Sadrian *        management request.  This method will construct a SCIC task request
86250003Sadrian *        internally.
87250003Sadrian *
88250003Sadrian * @note  The SCI framework implementation will create an association between
89250003Sadrian *        the user task request object and the framework task request object.
90250003Sadrian *
91250008Sadrian * @param[in]  scif_controller the handle to the framework controller object
92250008Sadrian *             for which to build an IO request.
93250003Sadrian * @param[in]  scif_remote_device This parameter specifies the framework
94250003Sadrian *             remote device with which this task request is to be associated.
95250003Sadrian * @param[in]  io_tag This parameter specifies the IO tag to be associated
96250003Sadrian *             with this request.  If SCI_CONTROLLER_INVALID_IO_TAG is
97250003Sadrian *             passed, then a copy of the request is built internally.  The
98250003Sadrian *             request will be copied into the actual controller request
99250003Sadrian *             memory when the IO tag is allocated internally during the
100250003Sadrian *             scif_controller_start_task() method.
101250003Sadrian * @param[in]  user_task_request_object This parameter specifies the user
102250003Sadrian *             task request to be utilized during task construction.  This task
103250003Sadrian *             pointer will become the associated object for the framework
104250003Sadrian *             task request object.
105250003Sadrian * @param[in]  task_request_memory This parameter specifies the memory
106250003Sadrian *             to be utilized in the construction of the framework task request.
107250003Sadrian * @param[in]  scif_task_request This parameter specifies the handle to be
108250003Sadrian *             utilized for all further interactions with this task request
109250003Sadrian *             object.
110250003Sadrian *
111250003Sadrian * @return Indicate if the controller successfully built the task request.
112250003Sadrian * @retval SCI_SUCCESS This value is returned if the task request was
113250003Sadrian *         successfully built.
114250003Sadrian */
115250003SadrianSCI_STATUS scif_task_request_construct(
116250003Sadrian   SCI_CONTROLLER_HANDLE_T      scif_controller,
117250003Sadrian   SCI_REMOTE_DEVICE_HANDLE_T   scif_remote_device,
118250003Sadrian   U16                          io_tag,
119250003Sadrian   void                       * user_task_request_object,
120250003Sadrian   void                       * task_request_memory,
121250003Sadrian   SCI_TASK_REQUEST_HANDLE_T  * scif_task_request
122250003Sadrian);
123250003Sadrian
124250003Sadrian#ifdef __cplusplus
125250003Sadrian}
126250003Sadrian#endif // __cplusplus
127250003Sadrian
128250003Sadrian#endif // _SCIF_TASK_REQUEST_H_
129250003Sadrian
130250003Sadrian