xref: /freebsd/sys/dev/isci/scil/scic_remote_device.h (revision 718cf2ccb9956613756ab15d7a0e28f2c8e91cab)
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  * $FreeBSD$
55f11c7f63SJim Harris  */
56f11c7f63SJim Harris #ifndef _SCIC_REMOTE_DEVICE_H_
57f11c7f63SJim Harris #define _SCIC_REMOTE_DEVICE_H_
58f11c7f63SJim Harris 
59f11c7f63SJim Harris /**
60f11c7f63SJim Harris  * @file
61f11c7f63SJim Harris  *
62f11c7f63SJim Harris  * @brief This file contains all of the interface methods that can be called
63f11c7f63SJim Harris  *        by an SCIC user on the device object.
64f11c7f63SJim Harris  */
65f11c7f63SJim Harris 
66f11c7f63SJim Harris #ifdef __cplusplus
67f11c7f63SJim Harris extern "C" {
68f11c7f63SJim Harris #endif // __cplusplus
69f11c7f63SJim Harris 
70f11c7f63SJim Harris #include <dev/isci/scil/sci_types.h>
71f11c7f63SJim Harris #include <dev/isci/scil/sci_status.h>
72f11c7f63SJim Harris #include <dev/isci/scil/intel_sas.h>
73f11c7f63SJim Harris 
74f11c7f63SJim Harris 
75f11c7f63SJim Harris /**
76f11c7f63SJim Harris  * @brief
77f11c7f63SJim Harris  */
78f11c7f63SJim Harris typedef enum SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE
79f11c7f63SJim Harris {
80f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED,
81f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED,
82f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED,
83f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED,
84f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED,
85f11c7f63SJim Harris 
86f11c7f63SJim Harris    SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE_MAX
87f11c7f63SJim Harris 
88f11c7f63SJim Harris } SCIC_REMOTE_DEVICE_NOT_READY_REASON_CODE_T;
89f11c7f63SJim Harris 
90f11c7f63SJim Harris /**
91f11c7f63SJim Harris  * @brief This method simply returns the maximum memory space needed to
92f11c7f63SJim Harris  *        store a remote device object.
93f11c7f63SJim Harris  *
94f11c7f63SJim Harris  * @return a positive integer value indicating the size (in bytes) of the
95f11c7f63SJim Harris  *         remote device object.
96f11c7f63SJim Harris  */
97f11c7f63SJim Harris U32 scic_remote_device_get_object_size(
98f11c7f63SJim Harris    void
99f11c7f63SJim Harris );
100f11c7f63SJim Harris 
101f11c7f63SJim Harris /**
102f11c7f63SJim Harris  * @brief This method will perform the construction common to all
103f11c7f63SJim Harris  *        remote device objects.
104f11c7f63SJim Harris  *
105f11c7f63SJim Harris  * @note  It isn't necessary to call scic_remote_device_destruct() for
106f11c7f63SJim Harris  *        device objects that have only called this method for construction.
107f11c7f63SJim Harris  *        Once subsequent construction methods have been invoked (e.g.
108f11c7f63SJim Harris  *        scic_remote_device_da_construct()), then destruction should occur.
109f11c7f63SJim Harris  * @note
110f11c7f63SJim Harris  *
111f11c7f63SJim Harris  * @param[in]  port This parameter specifies the SAS/SATA Port handle
112f11c7f63SJim Harris  *             corresponding to the port through which this device
113f11c7f63SJim Harris  *             is to be accessed.
114f11c7f63SJim Harris  * @param[in]  remote_device_memory This parameter specifies the memory
115f11c7f63SJim Harris  *             location to be used by the SCIC implementation to store the
116f11c7f63SJim Harris  *             SCIC REMOTE DEVICE.
117f11c7f63SJim Harris  * @param[out] new_remote_device_handle An opaque remote device handle to
118f11c7f63SJim Harris  *             be used by the SCIC user for all subsequent remote device
119f11c7f63SJim Harris  *             operations.
120f11c7f63SJim Harris  *
121f11c7f63SJim Harris  * @return none
122f11c7f63SJim Harris  */
123f11c7f63SJim Harris void scic_remote_device_construct(
124f11c7f63SJim Harris    SCI_PORT_HANDLE_T            port,
125f11c7f63SJim Harris    void                       * remote_device_memory,
126f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T * new_remote_device_handle
127f11c7f63SJim Harris );
128f11c7f63SJim Harris 
129f11c7f63SJim Harris /**
130f11c7f63SJim Harris  * @brief This method will construct a SCIC_REMOTE_DEVICE object for a
131f11c7f63SJim Harris  *        direct attached (da) device.  The information (e.g. IAF, Signature
132f11c7f63SJim Harris  *        FIS, etc.) necessary to build the device is known to the SCI Core
133f11c7f63SJim Harris  *        since it is contained in the scic_phy object.
134f11c7f63SJim Harris  *
135f11c7f63SJim Harris  * @pre The user must have previously called scic_remote_device_construct()
136f11c7f63SJim Harris  *
137f11c7f63SJim Harris  * @note  Remote device objects are a limited resource.  As such, they
138f11c7f63SJim Harris  *        must be protected.  Thus calls to construct and destruct are
139f11c7f63SJim Harris  *        mutually exclusive and non-reentrant.
140f11c7f63SJim Harris  *
141f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device to be
142f11c7f63SJim Harris  *             destructed.
143f11c7f63SJim Harris  *
144f11c7f63SJim Harris  * @return Indicate if the remote device was successfully constructed.
145f11c7f63SJim Harris  * @retval SCI_SUCCESS Returned if the device was successfully constructed.
146f11c7f63SJim Harris  * @retval SCI_FAILURE_DEVICE_EXISTS Returned if the device has already
147f11c7f63SJim Harris  *         been constructed.  If it's an additional phy for the target, then
148f11c7f63SJim Harris  *         call scic_remote_device_da_add_phy().
149f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL Returned if the supplied
150f11c7f63SJim Harris  *         parameters necessitate creation of a remote device for which
151f11c7f63SJim Harris  *         the protocol is not supported by the underlying controller
152f11c7f63SJim Harris  *         hardware.
153f11c7f63SJim Harris  * @retval SCI_FAILURE_INSUFFICIENT_RESOURCES This value is returned if
154f11c7f63SJim Harris  *         the core controller associated with the supplied parameters
155f11c7f63SJim Harris  *         is unable to support additional remote devices.
156f11c7f63SJim Harris  */
157f11c7f63SJim Harris SCI_STATUS scic_remote_device_da_construct(
158f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
159f11c7f63SJim Harris );
160f11c7f63SJim Harris 
161f11c7f63SJim Harris /**
162f11c7f63SJim Harris  * @brief This method will construct an SCIC_REMOTE_DEVICE object for an
163f11c7f63SJim Harris  *        expander attached (ea) device from an SMP Discover Response.
164f11c7f63SJim Harris  *
165f11c7f63SJim Harris  * @pre The user must have previously called scic_remote_device_construct()
166f11c7f63SJim Harris  *
167f11c7f63SJim Harris  * @note  Remote device objects are a limited resource.  As such, they
168f11c7f63SJim Harris  *        must be protected.  Thus calls to construct and destruct are
169f11c7f63SJim Harris  *        mutually exclusive and non-reentrant.
170f11c7f63SJim Harris  *
171f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device to be
172f11c7f63SJim Harris  *             destructed.
173f11c7f63SJim Harris  * @param[in]  discover_response This parameter specifies the SMP
174f11c7f63SJim Harris  *             Discovery Response to be used in device creation.
175f11c7f63SJim Harris  *
176f11c7f63SJim Harris  * @return Indicate if the remote device was successfully constructed.
177f11c7f63SJim Harris  * @retval SCI_SUCCESS Returned if the device was successfully constructed.
178f11c7f63SJim Harris  * @retval SCI_FAILURE_DEVICE_EXISTS Returned if the device has already
179f11c7f63SJim Harris  *         been constructed.  If it's an additional phy for the target, then
180f11c7f63SJim Harris  *         call scic_ea_remote_device_add_phy().
181f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL Returned if the supplied
182f11c7f63SJim Harris  *         parameters necessitate creation of a remote device for which
183f11c7f63SJim Harris  *         the protocol is not supported by the underlying controller
184f11c7f63SJim Harris  *         hardware.
185f11c7f63SJim Harris  * @retval SCI_FAILURE_INSUFFICIENT_RESOURCES This value is returned if
186f11c7f63SJim Harris  *         the core controller associated with the supplied parameters
187f11c7f63SJim Harris  *         is unable to support additional remote devices.
188f11c7f63SJim Harris  */
189f11c7f63SJim Harris SCI_STATUS scic_remote_device_ea_construct(
190f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T   remote_device,
191f11c7f63SJim Harris    SMP_RESPONSE_DISCOVER_T    * discover_response
192f11c7f63SJim Harris );
193f11c7f63SJim Harris 
194f11c7f63SJim Harris /**
195f11c7f63SJim Harris  * @brief This method is utilized to free up a core's remote device object.
196f11c7f63SJim Harris  *
197f11c7f63SJim Harris  * @note  Remote device objects are a limited resource.  As such, they
198f11c7f63SJim Harris  *        must be protected.  Thus calls to construct and destruct are
199f11c7f63SJim Harris  *        mutually exclusive and non-reentrant.
200f11c7f63SJim Harris  *
201f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device to be
202f11c7f63SJim Harris  *             destructed.
203f11c7f63SJim Harris  *
204f11c7f63SJim Harris  * @return The return value shall indicate if the device was successfully
205f11c7f63SJim Harris  *         destructed or if some failure occurred.
206f11c7f63SJim Harris  * @retval SCI_STATUS This value is returned if the device is successfully
207f11c7f63SJim Harris  *         destructed.
208f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_REMOTE_DEVICE This value is returned if the
209f11c7f63SJim Harris  *         supplied device isn't valid (e.g. it's already been destoryed,
210f11c7f63SJim Harris  *         the handle isn't valid, etc.).
211f11c7f63SJim Harris  */
212f11c7f63SJim Harris SCI_STATUS scic_remote_device_destruct(
213f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
214f11c7f63SJim Harris );
215f11c7f63SJim Harris 
216f11c7f63SJim Harris #if !defined(DISABLE_WIDE_PORTED_TARGETS)
217f11c7f63SJim Harris /**
218f11c7f63SJim Harris  * @brief This method will attempt to set port width for a remote device.
219f11c7f63SJim Harris  *
220f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device
221f11c7f63SJim Harris  *             object for which to set new port width.
222f11c7f63SJim Harris  * @param[in]  new_port_width The new port width to update.
223f11c7f63SJim Harris  *
224f11c7f63SJim Harris  * @return Indicate if the device port width was successfully updated.
225f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned when port width update was successful.
226f11c7f63SJim Harris  * @retval SCI_FAILURE The port width update failed.
227f11c7f63SJim Harris  */
228f11c7f63SJim Harris SCI_STATUS scic_remote_device_set_port_width(
229f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
230f11c7f63SJim Harris    U8                          new_port_width
231f11c7f63SJim Harris );
232f11c7f63SJim Harris 
233f11c7f63SJim Harris /**
234f11c7f63SJim Harris  * @brief This method retrieve the SCIC's record of a remote device's port width.
235f11c7f63SJim Harris  *
236f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the remote device
237f11c7f63SJim Harris  *             object for which to retrieve the port width value.
238f11c7f63SJim Harris  *
239f11c7f63SJim Harris  * @return The SCIC's record of a remote device's port width
240f11c7f63SJim Harris  */
241f11c7f63SJim Harris U8 scic_remote_device_get_port_width(
242f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
243f11c7f63SJim Harris );
244f11c7f63SJim Harris 
245f11c7f63SJim Harris #define scic_remote_device_da_add_phy(device, phy) SCI_FAILURE
246f11c7f63SJim Harris #define scic_remote_device_ea_add_phy(device, response) SCI_FAILURE
247f11c7f63SJim Harris #define scic_remote_device_remove_phy(device) SCI_FAILURE
248f11c7f63SJim Harris 
249f11c7f63SJim Harris #else // !defined(DISABLE_WIDE_PORTED_TARGETS)
250f11c7f63SJim Harris 
251f11c7f63SJim Harris #define scic_remote_device_set_port_width(device, port_width) SCI_FAILURE
252f11c7f63SJim Harris #define scic_remote_device_get_port_width(device) (1)
253f11c7f63SJim Harris 
254f11c7f63SJim Harris #define scic_remote_device_da_add_phy(device, phy) SCI_FAILURE
255f11c7f63SJim Harris #define scic_remote_device_ea_add_phy(device, response) SCI_FAILURE
256f11c7f63SJim Harris #define scic_remote_device_remove_phy(device) SCI_FAILURE
257f11c7f63SJim Harris 
258f11c7f63SJim Harris #endif // !defined(DISABLE_WIDE_PORTED_TARGETS)
259f11c7f63SJim Harris 
260f11c7f63SJim Harris /**
261f11c7f63SJim Harris  * @brief This method will start the supplied remote device.  This method
262f11c7f63SJim Harris  *        enables normal IO requests to flow through to the remote device.
263f11c7f63SJim Harris  *
264f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device to be
265f11c7f63SJim Harris  *             started.
266f11c7f63SJim Harris  * @param[in]  timeout This parameter specifies the number of milliseconds
267f11c7f63SJim Harris  *             in which the start operation should complete.
268f11c7f63SJim Harris  *
269f11c7f63SJim Harris  * @return An indication of whether the device was successfully started.
270f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the device was successfully
271f11c7f63SJim Harris  *         started.
272f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_PHY This value is returned if the user attempts
273f11c7f63SJim Harris  *         to start the device when there have been no phys added to it.
274f11c7f63SJim Harris  */
275f11c7f63SJim Harris SCI_STATUS scic_remote_device_start(
276f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
277f11c7f63SJim Harris    U32                         timeout
278f11c7f63SJim Harris );
279f11c7f63SJim Harris 
280f11c7f63SJim Harris /**
281f11c7f63SJim Harris  * @brief This method will stop both transmission and reception of link
282f11c7f63SJim Harris  *        activity for the supplied remote device.  This method disables
283f11c7f63SJim Harris  *        normal IO requests from flowing through to the remote device.
284f11c7f63SJim Harris  *
285f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device to be
286f11c7f63SJim Harris  *             stopped.
287f11c7f63SJim Harris  * @param[in]  timeout This parameter specifies the number of milliseconds
288f11c7f63SJim Harris  *             in which the stop operation should complete.
289f11c7f63SJim Harris  *
290f11c7f63SJim Harris  * @return An indication of whether the device was successfully stopped.
291f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the transmission and reception
292f11c7f63SJim Harris  *         for the device was successfully stopped.
293f11c7f63SJim Harris  */
294f11c7f63SJim Harris SCI_STATUS scic_remote_device_stop(
295f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
296f11c7f63SJim Harris    U32                         timeout
297f11c7f63SJim Harris );
298f11c7f63SJim Harris 
299f11c7f63SJim Harris /**
300f11c7f63SJim Harris  * @brief This method will reset the device making it ready for operation.
301f11c7f63SJim Harris  *        This method must be called anytime the device is reset either
302f11c7f63SJim Harris  *        through a SMP phy control or a port hard reset request.
303f11c7f63SJim Harris  *
304f11c7f63SJim Harris  * @note This method does not actually cause the device hardware to be reset.
305f11c7f63SJim Harris  *       This method resets the software object so that it will be operational
306f11c7f63SJim Harris  *       after a device hardware reset completes.
307f11c7f63SJim Harris  *
308f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device to be
309f11c7f63SJim Harris  *             reset.
310f11c7f63SJim Harris  *
311f11c7f63SJim Harris  * @return An indication of whether the device reset was accepted.
312f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the device reset is started.
313f11c7f63SJim Harris  */
314f11c7f63SJim Harris SCI_STATUS scic_remote_device_reset(
315f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
316f11c7f63SJim Harris );
317f11c7f63SJim Harris 
318f11c7f63SJim Harris /**
319f11c7f63SJim Harris  * @brief This method informs the device object that the reset operation is
320f11c7f63SJim Harris  *        complete and the device can resume operation again.
321f11c7f63SJim Harris  *
322f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device which is to
323f11c7f63SJim Harris  *             be informed of the reset complete operation.
324f11c7f63SJim Harris  *
325f11c7f63SJim Harris  * @return An indication that the device is resuming operation.
326f11c7f63SJim Harris  * @retval SCI_SUCCESS the device is resuming operation.
327f11c7f63SJim Harris  */
328f11c7f63SJim Harris SCI_STATUS scic_remote_device_reset_complete(
329f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
330f11c7f63SJim Harris );
331f11c7f63SJim Harris 
332f11c7f63SJim Harris /**
333f11c7f63SJim Harris  * @brief This method returns the suggested target reset timeout.  SAS and
334f11c7f63SJim Harris  *        SATA devices have different timeout values in milliseconds for
335f11c7f63SJim Harris  *        target reset operations.
336f11c7f63SJim Harris  *
337f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device which is to
338f11c7f63SJim Harris  *             be informed of the reset complete operation.
339f11c7f63SJim Harris  *
340f11c7f63SJim Harris  * @return The suggested reset timeout value for the specified target device
341f11c7f63SJim Harris  *         in milliseconds.
342f11c7f63SJim Harris  */
343f11c7f63SJim Harris U32 scic_remote_device_get_suggested_reset_timeout(
344f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
345f11c7f63SJim Harris );
346f11c7f63SJim Harris 
347f11c7f63SJim Harris /**
348f11c7f63SJim Harris  * @brief This method will set the maximum link speed to be utilized
349f11c7f63SJim Harris  *        when connections are established for the supplied remote device.
350f11c7f63SJim Harris  *
351f11c7f63SJim Harris  * @pre The remote device must previously have been stopped for this
352f11c7f63SJim Harris  *      call to succeed.
353f11c7f63SJim Harris  *
354f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device for which
355f11c7f63SJim Harris  *             to set the maximum connection rate.
356f11c7f63SJim Harris  * @param[in]  connection_rate This parameter specifies the maximum link rate
357f11c7f63SJim Harris  *             to be utilized for all connections to the supplied remote
358f11c7f63SJim Harris  *             device.
359f11c7f63SJim Harris  *
360f11c7f63SJim Harris  * @return An indication as to whether the connection rate was successfully
361f11c7f63SJim Harris  *         updated.
362f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the connection rate was
363f11c7f63SJim Harris  *         successfully updated.
364f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_STATE This value is returned if the remote
365f11c7f63SJim Harris  *         device is not in a stopped state or some other state that allows
366f11c7f63SJim Harris  *         for a maximum connection rate change.
367f11c7f63SJim Harris  */
368f11c7f63SJim Harris SCI_STATUS scic_remote_device_set_max_connection_rate(
369f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device,
370f11c7f63SJim Harris    SCI_SAS_LINK_RATE           connection_rate
371f11c7f63SJim Harris );
372f11c7f63SJim Harris 
373f11c7f63SJim Harris /**
374f11c7f63SJim Harris  * @brief This method simply returns the link rate at which communications
375f11c7f63SJim Harris  *        to the remote device occur.
376f11c7f63SJim Harris  *
377f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device for which
378f11c7f63SJim Harris  *             to get the connection rate.
379f11c7f63SJim Harris  *
380f11c7f63SJim Harris  * @return Return the link rate at which we transfer for the supplied
381f11c7f63SJim Harris  *         remote device.
382f11c7f63SJim Harris  */
383f11c7f63SJim Harris SCI_SAS_LINK_RATE scic_remote_device_get_connection_rate(
384f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T  remote_device
385f11c7f63SJim Harris );
386f11c7f63SJim Harris 
387f11c7f63SJim Harris /**
388f11c7f63SJim Harris  * @brief This method will indicate which protocols are supported by this
389f11c7f63SJim Harris  *        remote device.
390f11c7f63SJim Harris  *
391f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device for which
392f11c7f63SJim Harris  *             to return the protocol.
393f11c7f63SJim Harris  * @param[out] protocols This parameter specifies the output values, from
394f11c7f63SJim Harris  *             the remote device object, which indicate the protocols
395f11c7f63SJim Harris  *             supported by the supplied remote_device.
396f11c7f63SJim Harris  *
397f11c7f63SJim Harris  * @return The type of protocols supported by this device.  The values are
398f11c7f63SJim Harris  *         returned as part of a bit mask in order to allow for multi-protocol
399f11c7f63SJim Harris  *         support.
400f11c7f63SJim Harris  */
401f11c7f63SJim Harris void scic_remote_device_get_protocols(
402f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T          remote_device,
403f11c7f63SJim Harris    SMP_DISCOVER_RESPONSE_PROTOCOLS_T * protocols
404f11c7f63SJim Harris );
405f11c7f63SJim Harris 
406f11c7f63SJim Harris /**
407f11c7f63SJim Harris  * @brief This method will indicate the SAS address for the remote device.
408f11c7f63SJim Harris  *
409f11c7f63SJim Harris  * @param[in]  remote_device This parameter specifies the device for which
410f11c7f63SJim Harris  *             to return the SAS address.
411f11c7f63SJim Harris  * @param[out] sas_address This parameter specifies a pointer to a SAS
412f11c7f63SJim Harris  *             address structure into which the core will copy the SAS
413f11c7f63SJim Harris  *             address for the remote device.
414f11c7f63SJim Harris  *
415f11c7f63SJim Harris  * @return none
416f11c7f63SJim Harris  */
417f11c7f63SJim Harris void scic_remote_device_get_sas_address(
418f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T   remote_device,
419f11c7f63SJim Harris    SCI_SAS_ADDRESS_T          * sas_address
420f11c7f63SJim Harris );
421f11c7f63SJim Harris 
422f11c7f63SJim Harris #if !defined(DISABLE_ATAPI)
423f11c7f63SJim Harris /**
424f11c7f63SJim Harris  * This method first decide whether a device is a stp target, then
425f11c7f63SJim Harris  *    decode the signature fis of a DA STP device to tell whether it
426f11c7f63SJim Harris  *    is a standard end disk or an ATAPI device.
427f11c7f63SJim Harris  *
428f11c7f63SJim Harris  * @param[in] this_device The device whose type is to be decided.
429f11c7f63SJim Harris  *
430f11c7f63SJim Harris  * @return BOOL Indicate a device is ATAPI device or not.
431f11c7f63SJim Harris  */
432f11c7f63SJim Harris BOOL scic_remote_device_is_atapi(
433f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T device_handle
434f11c7f63SJim Harris );
435f11c7f63SJim Harris #else // !defined(DISABLE_ATAPI)
436f11c7f63SJim Harris #define scic_remote_device_is_atapi(device_handle) FALSE
437f11c7f63SJim Harris #endif // !defined(DISABLE_ATAPI)
438f11c7f63SJim Harris 
439f11c7f63SJim Harris #ifdef __cplusplus
440f11c7f63SJim Harris }
441f11c7f63SJim Harris #endif // __cplusplus
442f11c7f63SJim Harris 
443f11c7f63SJim Harris #endif // _SCIC_REMOTE_DEVICE_H_
444f11c7f63SJim Harris 
445