xref: /freebsd/sys/dev/isci/scil/scic_remote_device.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1f11c7f63SJim Harris /*-
2*718cf2ccSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
3*718cf2ccSPedro F. Giffuni  *
4f11c7f63SJim Harris  * This file is provided under a dual BSD/GPLv2 license.  When using or
5f11c7f63SJim Harris  * redistributing this file, you may do so under either license.
6f11c7f63SJim Harris  *
7f11c7f63SJim Harris  * GPL LICENSE SUMMARY
8f11c7f63SJim Harris  *
9f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
10f11c7f63SJim Harris  *
11f11c7f63SJim Harris  * This program is free software; you can redistribute it and/or modify
12f11c7f63SJim Harris  * it under the terms of version 2 of the GNU General Public License as
13f11c7f63SJim Harris  * published by the Free Software Foundation.
14f11c7f63SJim Harris  *
15f11c7f63SJim Harris  * This program is distributed in the hope that it will be useful, but
16f11c7f63SJim Harris  * WITHOUT ANY WARRANTY; without even the implied warranty of
17f11c7f63SJim Harris  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18f11c7f63SJim Harris  * General Public License for more details.
19f11c7f63SJim Harris  *
20f11c7f63SJim Harris  * You should have received a copy of the GNU General Public License
21f11c7f63SJim Harris  * along with this program; if not, write to the Free Software
22f11c7f63SJim Harris  * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23f11c7f63SJim Harris  * The full GNU General Public License is included in this distribution
24f11c7f63SJim Harris  * in the file called LICENSE.GPL.
25f11c7f63SJim Harris  *
26f11c7f63SJim Harris  * BSD LICENSE
27f11c7f63SJim Harris  *
28f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29f11c7f63SJim Harris  * All rights reserved.
30f11c7f63SJim Harris  *
31f11c7f63SJim Harris  * Redistribution and use in source and binary forms, with or without
32f11c7f63SJim Harris  * modification, are permitted provided that the following conditions
33f11c7f63SJim Harris  * are met:
34f11c7f63SJim Harris  *
35f11c7f63SJim Harris  *   * Redistributions of source code must retain the above copyright
36f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer.
37f11c7f63SJim Harris  *   * Redistributions in binary form must reproduce the above copyright
38f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer in
39f11c7f63SJim Harris  *     the documentation and/or other materials provided with the
40f11c7f63SJim Harris  *     distribution.
41f11c7f63SJim Harris  *
42f11c7f63SJim Harris  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43f11c7f63SJim Harris  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44f11c7f63SJim Harris  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45f11c7f63SJim Harris  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46f11c7f63SJim Harris  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47f11c7f63SJim Harris  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48f11c7f63SJim Harris  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49f11c7f63SJim Harris  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50f11c7f63SJim Harris  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51f11c7f63SJim Harris  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52f11c7f63SJim Harris  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53f11c7f63SJim Harris  */
54f11c7f63SJim Harris #ifndef _SCIC_REMOTE_DEVICE_H_
55f11c7f63SJim Harris #define _SCIC_REMOTE_DEVICE_H_
56f11c7f63SJim Harris 
57f11c7f63SJim Harris /**
58f11c7f63SJim Harris  * @file
59f11c7f63SJim Harris  *
60f11c7f63SJim Harris  * @brief This file contains all of the interface methods that can be called
61f11c7f63SJim Harris  *        by an SCIC user on the device object.
62f11c7f63SJim Harris  */
63f11c7f63SJim Harris 
64f11c7f63SJim Harris #ifdef __cplusplus
65f11c7f63SJim Harris extern "C" {
66f11c7f63SJim Harris #endif // __cplusplus
67f11c7f63SJim Harris 
68f11c7f63SJim Harris #include <dev/isci/scil/sci_types.h>
69f11c7f63SJim Harris #include <dev/isci/scil/sci_status.h>
70f11c7f63SJim Harris #include <dev/isci/scil/intel_sas.h>
71f11c7f63SJim Harris 
72f11c7f63SJim Harris 
73f11c7f63SJim Harris /**
74f11c7f63SJim Harris  * @brief
75f11c7f63SJim Harris  */
76f11c7f63SJim Harris typedef enum SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE
77f11c7f63SJim Harris {
78f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED,
79f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED,
80f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED,
81f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED,
82f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED,
83f11c7f63SJim Harris 
84f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE_MAX
85f11c7f63SJim Harris 
86f11c7f63SJim Harris } SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE_T;
87f11c7f63SJim Harris 
88f11c7f63SJim Harris /**
89f11c7f63SJim Harris  * @brief This method simply returns the maximum memory space needed to
90f11c7f63SJim Harris  *        store a remote device object.
91f11c7f63SJim Harris  *
92f11c7f63SJim Harris  * @return a positive integer value indicating the size (in bytes) of the
93f11c7f63SJim Harris  *         remote device object.
94f11c7f63SJim Harris  */
95f11c7f63SJim Harris U32 scic_remote_device_get_object_size(
96f11c7f63SJim Harris    void
97f11c7f63SJim Harris );
98f11c7f63SJim Harris 
99f11c7f63SJim Harris /**
100f11c7f63SJim Harris  * @brief This method will perform the construction common to all
101f11c7f63SJim Harris  *        remote device objects.
102f11c7f63SJim Harris  *
103f11c7f63SJim Harris  * @note  It isn't necessary to call scic_remote_device_destruct() for
104f11c7f63SJim Harris  *        device objects that have only called this method for construction.
105f11c7f63SJim Harris  *        Once subsequent construction methods have been invoked (e.g.
106f11c7f63SJim Harris  *        scic_remote_device_da_construct()), then destruction should occur.
107f11c7f63SJim Harris  * @note
108f11c7f63SJim Harris  *
109f11c7f63SJim Harris  * @param[in]  port This parameter specifies the SAS/SATA Port handle
110f11c7f63SJim Harris  *             corresponding to the port through which this device
111f11c7f63SJim Harris  *             is to be accessed.
112f11c7f63SJim Harris  * @param[in]  remote_device_memory This parameter specifies the memory
113f11c7f63SJim Harris  *             location to be used by the SCIC implementation to store the
114f11c7f63SJim Harris  *             SCIC REMOTE DEVICE.
115f11c7f63SJim Harris  * @param[out] new_remote_device_handle An opaque remote device handle to
116f11c7f63SJim Harris  *             be used by the SCIC user for all subsequent remote device
117f11c7f63SJim Harris  *             operations.
118f11c7f63SJim Harris  *
119f11c7f63SJim Harris  * @return none
120f11c7f63SJim Harris  */
121f11c7f63SJim Harris void scic_remote_device_construct(
122f11c7f63SJim Harris    SCI_PORT_HANDLE_T            port,
123f11c7f63SJim Harris    void                       * remote_device_memory,
124f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T * new_remote_device_handle
125f11c7f63SJim Harris );
126f11c7f63SJim Harris 
127f11c7f63SJim Harris /**
128f11c7f63SJim Harris  * @brief This method will construct a SCIC_REMOTE_DEVICE object for a
129f11c7f63SJim Harris  *        direct attached (da) device.  The information (e.g. IAF, Signature
130f11c7f63SJim Harris  *        FIS, etc.) necessary to build the device is known to the SCI Core
131f11c7f63SJim Harris  *        since it is contained in the scic_phy object.
132f11c7f63SJim Harris  *
133f11c7f63SJim Harris  * @pre The user must have previously called scic_remote_device_construct()
134f11c7f63SJim Harris  *
135f11c7f63SJim Harris  * @note  Remote device objects are a limited resource.  As such, they
136f11c7f63SJim Harris  *        must be protected.  Thus calls to construct and destruct are
137f11c7f63SJim Harris  *        mutually exclusive and non-reentrant.
138f11c7f63SJim Harris  *
139f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device to be
140f11c7f63SJim Harris  *             destructed.
141f11c7f63SJim Harris  *
142f11c7f63SJim Harris  * @return Indicate if the remote device was successfully constructed.
143f11c7f63SJim Harris  * @retval SCI_SUCCESS Returned if the device was successfully constructed.
144f11c7f63SJim Harris  * @retval SCI_FAILURE_DEVICE_EXISTS Returned if the device has already
145f11c7f63SJim Harris  *         been constructed.  If it's an additional phy for the target, then
146f11c7f63SJim Harris  *         call scic_remote_device_da_add_phy().
147f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL Returned if the supplied
148f11c7f63SJim Harris  *         parameters necessitate creation of a remote device for which
149f11c7f63SJim Harris  *         the protocol is not supported by the underlying controller
150f11c7f63SJim Harris  *         hardware.
151f11c7f63SJim Harris  * @retval SCI_FAILURE_INSUFFICIENT_RESOURCES This value is returned if
152f11c7f63SJim Harris  *         the core controller associated with the supplied parameters
153f11c7f63SJim Harris  *         is unable to support additional remote devices.
154f11c7f63SJim Harris  */
155f11c7f63SJim Harris SCI_STATUS scic_remote_device_da_construct(
156f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
157f11c7f63SJim Harris );
158f11c7f63SJim Harris 
159f11c7f63SJim Harris /**
160f11c7f63SJim Harris  * @brief This method will construct an SCIC_REMOTE_DEVICE object for an
161f11c7f63SJim Harris  *        expander attached (ea) device from an SMP Discover Response.
162f11c7f63SJim Harris  *
163f11c7f63SJim Harris  * @pre The user must have previously called scic_remote_device_construct()
164f11c7f63SJim Harris  *
165f11c7f63SJim Harris  * @note  Remote device objects are a limited resource.  As such, they
166f11c7f63SJim Harris  *        must be protected.  Thus calls to construct and destruct are
167f11c7f63SJim Harris  *        mutually exclusive and non-reentrant.
168f11c7f63SJim Harris  *
169f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device to be
170f11c7f63SJim Harris  *             destructed.
171f11c7f63SJim Harris  * @param[in]  discover_response This parameter specifies the SMP
172f11c7f63SJim Harris  *             Discovery Response to be used in device creation.
173f11c7f63SJim Harris  *
174f11c7f63SJim Harris  * @return Indicate if the remote device was successfully constructed.
175f11c7f63SJim Harris  * @retval SCI_SUCCESS Returned if the device was successfully constructed.
176f11c7f63SJim Harris  * @retval SCI_FAILURE_DEVICE_EXISTS Returned if the device has already
177f11c7f63SJim Harris  *         been constructed.  If it's an additional phy for the target, then
178f11c7f63SJim Harris  *         call scic_ea_remote_device_add_phy().
179f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL Returned if the supplied
180f11c7f63SJim Harris  *         parameters necessitate creation of a remote device for which
181f11c7f63SJim Harris  *         the protocol is not supported by the underlying controller
182f11c7f63SJim Harris  *         hardware.
183f11c7f63SJim Harris  * @retval SCI_FAILURE_INSUFFICIENT_RESOURCES This value is returned if
184f11c7f63SJim Harris  *         the core controller associated with the supplied parameters
185f11c7f63SJim Harris  *         is unable to support additional remote devices.
186f11c7f63SJim Harris  */
187f11c7f63SJim Harris SCI_STATUS scic_remote_device_ea_construct(
188f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T   remote_device,
189f11c7f63SJim Harris    SMP_RESPONSE_DISCOVER_T    * discover_response
190f11c7f63SJim Harris );
191f11c7f63SJim Harris 
192f11c7f63SJim Harris /**
193f11c7f63SJim Harris  * @brief This method is utilized to free up a core's remote device object.
194f11c7f63SJim Harris  *
195f11c7f63SJim Harris  * @note  Remote device objects are a limited resource.  As such, they
196f11c7f63SJim Harris  *        must be protected.  Thus calls to construct and destruct are
197f11c7f63SJim Harris  *        mutually exclusive and non-reentrant.
198f11c7f63SJim Harris  *
199f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device to be
200f11c7f63SJim Harris  *             destructed.
201f11c7f63SJim Harris  *
202f11c7f63SJim Harris  * @return The return value shall indicate if the device was successfully
203f11c7f63SJim Harris  *         destructed or if some failure occurred.
204f11c7f63SJim Harris  * @retval SCI_STATUS This value is returned if the device is successfully
205f11c7f63SJim Harris  *         destructed.
206f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_REMOTE_DEVICE This value is returned if the
207f11c7f63SJim Harris  *         supplied device isn't valid (e.g. it's already been destoryed,
208f11c7f63SJim Harris  *         the handle isn't valid, etc.).
209f11c7f63SJim Harris  */
210f11c7f63SJim Harris SCI_STATUS scic_remote_device_destruct(
211f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
212f11c7f63SJim Harris );
213f11c7f63SJim Harris 
214f11c7f63SJim Harris #if !defined(DISABLE_WIDE_PORTED_TARGETS)
215f11c7f63SJim Harris /**
216f11c7f63SJim Harris  * @brief This method will attempt to set port width for a remote device.
217f11c7f63SJim Harris  *
218f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device
219f11c7f63SJim Harris  *             object for which to set new port width.
220f11c7f63SJim Harris  * @param[in]  new_port_width The new port width to update.
221f11c7f63SJim Harris  *
222f11c7f63SJim Harris  * @return Indicate if the device port width was successfully updated.
223f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned when port width update was successful.
224f11c7f63SJim Harris  * @retval SCI_FAILURE The port width update failed.
225f11c7f63SJim Harris  */
226f11c7f63SJim Harris SCI_STATUS scic_remote_device_set_port_width(
227f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
228f11c7f63SJim Harris    U8                          new_port_width
229f11c7f63SJim Harris );
230f11c7f63SJim Harris 
231f11c7f63SJim Harris /**
232f11c7f63SJim Harris  * @brief This method retrieve the SCIC's record of a remote device's port width.
233f11c7f63SJim Harris  *
234f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device
235f11c7f63SJim Harris  *             object for which to retrieve the port width value.
236f11c7f63SJim Harris  *
237f11c7f63SJim Harris  * @return The SCIC's record of a remote device's port width
238f11c7f63SJim Harris  */
239f11c7f63SJim Harris U8 scic_remote_device_get_port_width(
240f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
241f11c7f63SJim Harris );
242f11c7f63SJim Harris 
243f11c7f63SJim Harris #define scic_remote_device_da_add_phy(device, phy) SCI_FAILURE
244f11c7f63SJim Harris #define scic_remote_device_ea_add_phy(device, response) SCI_FAILURE
245f11c7f63SJim Harris #define scic_remote_device_remove_phy(device) SCI_FAILURE
246f11c7f63SJim Harris 
247f11c7f63SJim Harris #else // !defined(DISABLE_WIDE_PORTED_TARGETS)
248f11c7f63SJim Harris 
249f11c7f63SJim Harris #define scic_remote_device_set_port_width(device, port_width) SCI_FAILURE
250f11c7f63SJim Harris #define scic_remote_device_get_port_width(device) (1)
251f11c7f63SJim Harris 
252f11c7f63SJim Harris #define scic_remote_device_da_add_phy(device, phy) SCI_FAILURE
253f11c7f63SJim Harris #define scic_remote_device_ea_add_phy(device, response) SCI_FAILURE
254f11c7f63SJim Harris #define scic_remote_device_remove_phy(device) SCI_FAILURE
255f11c7f63SJim Harris 
256f11c7f63SJim Harris #endif // !defined(DISABLE_WIDE_PORTED_TARGETS)
257f11c7f63SJim Harris 
258f11c7f63SJim Harris /**
259f11c7f63SJim Harris  * @brief This method will start the supplied remote device.  This method
260f11c7f63SJim Harris  *        enables normal IO requests to flow through to the remote device.
261f11c7f63SJim Harris  *
262f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device to be
263f11c7f63SJim Harris  *             started.
264f11c7f63SJim Harris  * @param[in]  timeout This parameter specifies the number of milliseconds
265f11c7f63SJim Harris  *             in which the start operation should complete.
266f11c7f63SJim Harris  *
267f11c7f63SJim Harris  * @return An indication of whether the device was successfully started.
268f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the device was successfully
269f11c7f63SJim Harris  *         started.
270f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_PHY This value is returned if the user attempts
271f11c7f63SJim Harris  *         to start the device when there have been no phys added to it.
272f11c7f63SJim Harris  */
273f11c7f63SJim Harris SCI_STATUS scic_remote_device_start(
274f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
275f11c7f63SJim Harris    U32                         timeout
276f11c7f63SJim Harris );
277f11c7f63SJim Harris 
278f11c7f63SJim Harris /**
279f11c7f63SJim Harris  * @brief This method will stop both transmission and reception of link
280f11c7f63SJim Harris  *        activity for the supplied remote device.  This method disables
281f11c7f63SJim Harris  *        normal IO requests from flowing through to the remote device.
282f11c7f63SJim Harris  *
283f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device to be
284f11c7f63SJim Harris  *             stopped.
285f11c7f63SJim Harris  * @param[in]  timeout This parameter specifies the number of milliseconds
286f11c7f63SJim Harris  *             in which the stop operation should complete.
287f11c7f63SJim Harris  *
288f11c7f63SJim Harris  * @return An indication of whether the device was successfully stopped.
289f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the transmission and reception
290f11c7f63SJim Harris  *         for the device was successfully stopped.
291f11c7f63SJim Harris  */
292f11c7f63SJim Harris SCI_STATUS scic_remote_device_stop(
293f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
294f11c7f63SJim Harris    U32                         timeout
295f11c7f63SJim Harris );
296f11c7f63SJim Harris 
297f11c7f63SJim Harris /**
298f11c7f63SJim Harris  * @brief This method will reset the device making it ready for operation.
299f11c7f63SJim Harris  *        This method must be called anytime the device is reset either
300f11c7f63SJim Harris  *        through a SMP phy control or a port hard reset request.
301f11c7f63SJim Harris  *
302f11c7f63SJim Harris  * @note This method does not actually cause the device hardware to be reset.
303f11c7f63SJim Harris  *       This method resets the software object so that it will be operational
304f11c7f63SJim Harris  *       after a device hardware reset completes.
305f11c7f63SJim Harris  *
306f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device to be
307f11c7f63SJim Harris  *             reset.
308f11c7f63SJim Harris  *
309f11c7f63SJim Harris  * @return An indication of whether the device reset was accepted.
310f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the device reset is started.
311f11c7f63SJim Harris  */
312f11c7f63SJim Harris SCI_STATUS scic_remote_device_reset(
313f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
314f11c7f63SJim Harris );
315f11c7f63SJim Harris 
316f11c7f63SJim Harris /**
317f11c7f63SJim Harris  * @brief This method informs the device object that the reset operation is
318f11c7f63SJim Harris  *        complete and the device can resume operation again.
319f11c7f63SJim Harris  *
320f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device which is to
321f11c7f63SJim Harris  *             be informed of the reset complete operation.
322f11c7f63SJim Harris  *
323f11c7f63SJim Harris  * @return An indication that the device is resuming operation.
324f11c7f63SJim Harris  * @retval SCI_SUCCESS the device is resuming operation.
325f11c7f63SJim Harris  */
326f11c7f63SJim Harris SCI_STATUS scic_remote_device_reset_complete(
327f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
328f11c7f63SJim Harris );
329f11c7f63SJim Harris 
330f11c7f63SJim Harris /**
331f11c7f63SJim Harris  * @brief This method returns the suggested target reset timeout.  SAS and
332f11c7f63SJim Harris  *        SATA devices have different timeout values in milliseconds for
333f11c7f63SJim Harris  *        target reset operations.
334f11c7f63SJim Harris  *
335f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device which is to
336f11c7f63SJim Harris  *             be informed of the reset complete operation.
337f11c7f63SJim Harris  *
338f11c7f63SJim Harris  * @return The suggested reset timeout value for the specified target device
339f11c7f63SJim Harris  *         in milliseconds.
340f11c7f63SJim Harris  */
341f11c7f63SJim Harris U32 scic_remote_device_get_suggested_reset_timeout(
342f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
343f11c7f63SJim Harris );
344f11c7f63SJim Harris 
345f11c7f63SJim Harris /**
346f11c7f63SJim Harris  * @brief This method will set the maximum link speed to be utilized
347f11c7f63SJim Harris  *        when connections are established for the supplied remote device.
348f11c7f63SJim Harris  *
349f11c7f63SJim Harris  * @pre The remote device must previously have been stopped for this
350f11c7f63SJim Harris  *      call to succeed.
351f11c7f63SJim Harris  *
352f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device for which
353f11c7f63SJim Harris  *             to set the maximum connection rate.
354f11c7f63SJim Harris  * @param[in]  connection_rate This parameter specifies the maximum link rate
355f11c7f63SJim Harris  *             to be utilized for all connections to the supplied remote
356f11c7f63SJim Harris  *             device.
357f11c7f63SJim Harris  *
358f11c7f63SJim Harris  * @return An indication as to whether the connection rate was successfully
359f11c7f63SJim Harris  *         updated.
360f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the connection rate was
361f11c7f63SJim Harris  *         successfully updated.
362f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_STATE This value is returned if the remote
363f11c7f63SJim Harris  *         device is not in a stopped state or some other state that allows
364f11c7f63SJim Harris  *         for a maximum connection rate change.
365f11c7f63SJim Harris  */
366f11c7f63SJim Harris SCI_STATUS scic_remote_device_set_max_connection_rate(
367f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
368f11c7f63SJim Harris    SCI_SAS_LINK_RATE           connection_rate
369f11c7f63SJim Harris );
370f11c7f63SJim Harris 
371f11c7f63SJim Harris /**
372f11c7f63SJim Harris  * @brief This method simply returns the link rate at which communications
373f11c7f63SJim Harris  *        to the remote device occur.
374f11c7f63SJim Harris  *
375f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device for which
376f11c7f63SJim Harris  *             to get the connection rate.
377f11c7f63SJim Harris  *
378f11c7f63SJim Harris  * @return Return the link rate at which we transfer for the supplied
379f11c7f63SJim Harris  *         remote device.
380f11c7f63SJim Harris  */
381f11c7f63SJim Harris SCI_SAS_LINK_RATE scic_remote_device_get_connection_rate(
382f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
383f11c7f63SJim Harris );
384f11c7f63SJim Harris 
385f11c7f63SJim Harris /**
386f11c7f63SJim Harris  * @brief This method will indicate which protocols are supported by this
387f11c7f63SJim Harris  *        remote device.
388f11c7f63SJim Harris  *
389f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device for which
390f11c7f63SJim Harris  *             to return the protocol.
391f11c7f63SJim Harris  * @param[out] protocols This parameter specifies the output values, from
392f11c7f63SJim Harris  *             the remote device object, which indicate the protocols
393f11c7f63SJim Harris  *             supported by the supplied remote_device.
394f11c7f63SJim Harris  *
395f11c7f63SJim Harris  * @return The type of protocols supported by this device.  The values are
396f11c7f63SJim Harris  *         returned as part of a bit mask in order to allow for multi-protocol
397f11c7f63SJim Harris  *         support.
398f11c7f63SJim Harris  */
399f11c7f63SJim Harris void scic_remote_device_get_protocols(
400f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T          remote_device,
401f11c7f63SJim Harris    SMP_DISCOVER_RESPONSE_PROTOCOLS_T * protocols
402f11c7f63SJim Harris );
403f11c7f63SJim Harris 
404f11c7f63SJim Harris /**
405f11c7f63SJim Harris  * @brief This method will indicate the SAS address for the remote device.
406f11c7f63SJim Harris  *
407f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device for which
408f11c7f63SJim Harris  *             to return the SAS address.
409f11c7f63SJim Harris  * @param[out] sas_address This parameter specifies a pointer to a SAS
410f11c7f63SJim Harris  *             address structure into which the core will copy the SAS
411f11c7f63SJim Harris  *             address for the remote device.
412f11c7f63SJim Harris  *
413f11c7f63SJim Harris  * @return none
414f11c7f63SJim Harris  */
415f11c7f63SJim Harris void scic_remote_device_get_sas_address(
416f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T   remote_device,
417f11c7f63SJim Harris    SCI_SAS_ADDRESS_T          * sas_address
418f11c7f63SJim Harris );
419f11c7f63SJim Harris 
420f11c7f63SJim Harris #if !defined(DISABLE_ATAPI)
421f11c7f63SJim Harris /**
422f11c7f63SJim Harris  * This method first decide whether a device is a stp target, then
423f11c7f63SJim Harris  *    decode the signature fis of a DA STP device to tell whether it
424f11c7f63SJim Harris  *    is a standard end disk or an ATAPI device.
425f11c7f63SJim Harris  *
426f11c7f63SJim Harris  * @param[in] this_device The device whose type is to be decided.
427f11c7f63SJim Harris  *
428f11c7f63SJim Harris  * @return BOOL Indicate a device is ATAPI device or not.
429f11c7f63SJim Harris  */
430f11c7f63SJim Harris BOOL scic_remote_device_is_atapi(
431f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T device_handle
432f11c7f63SJim Harris );
433f11c7f63SJim Harris #else // !defined(DISABLE_ATAPI)
434f11c7f63SJim Harris #define scic_remote_device_is_atapi(device_handle) FALSE
435f11c7f63SJim Harris #endif // !defined(DISABLE_ATAPI)
436f11c7f63SJim Harris 
437f11c7f63SJim Harris #ifdef __cplusplus
438f11c7f63SJim Harris }
439f11c7f63SJim Harris #endif // __cplusplus
440f11c7f63SJim Harris 
441f11c7f63SJim Harris #endif // _SCIC_REMOTE_DEVICE_H_
442f11c7f63SJim Harris 
443