2 * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
9 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
23 * The full GNU General Public License is included in this distribution
24 * in the file called LICENSE.GPL.
28 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
29 * All rights reserved.
31 * Redistribution and use in source and binary forms, with or without
32 * modification, are permitted provided that the following conditions
35 * * Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * * Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in
39 * the documentation and/or other materials provided with the
42 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 * @brief This file contains all of the interface methods that can be called
63 * by an SCI Core user on a SAS or SATA port.
70 #include <dev/isci/scil/sci_types.h>
71 #include <dev/isci/scil/sci_status.h>
72 #include <dev/isci/scil/intel_sas.h>
74 enum SCIC_PORT_NOT_READY_REASON_CODE
76 SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS,
77 SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED,
78 SCIC_PORT_NOT_READY_INVALID_PORT_CONFIGURATION,
79 SCIC_PORT_NOT_READY_RECONFIGURING,
81 SCIC_PORT_NOT_READY_REASON_CODE_MAX
85 * @struct SCIC_PORT_END_POINT_PROPERTIES
86 * @brief This structure defines the properties that can be retrieved
87 * for each end-point local or remote (attached) port in the
90 typedef struct SCIC_PORT_END_POINT_PROPERTIES
93 * This field indicates the SAS address for the associated end
96 SCI_SAS_ADDRESS_T sas_address;
99 * This field indicates the protocols supported by the associated
100 * end-point in the port.
102 SCI_SAS_IDENTIFY_ADDRESS_FRAME_PROTOCOLS_T protocols;
104 } SCIC_PORT_END_POINT_PROPERTIES_T;
107 * @struct SCIC_PORT_PROPERTIES
108 * @brief This structure defines the properties that can be retrieved
109 * for each port in the controller.
111 typedef struct SCIC_PORT_PROPERTIES
114 * This field specifies the logical index of the port (0 relative).
119 * This field indicates the local end-point properties for port.
121 SCIC_PORT_END_POINT_PROPERTIES_T local;
124 * This field indicates the remote (attached) end-point properties
127 SCIC_PORT_END_POINT_PROPERTIES_T remote;
130 * This field specifies the phys contained inside the port.
134 } SCIC_PORT_PROPERTIES_T;
137 * @brief This method simply returns the properties regarding the
138 * port, such as: physical index, protocols, sas address, etc.
140 * @param[in] port this parameter specifies the port for which to retrieve
141 * the physical index.
142 * @param[out] properties This parameter specifies the properties
143 * structure into which to copy the requested information.
145 * @return Indicate if the user specified a valid port.
146 * @retval SCI_SUCCESS This value is returned if the specified port was valid.
147 * @retval SCI_FAILURE_INVALID_PORT This value is returned if the specified port
148 * is not valid. When this value is returned, no data is copied to the
149 * properties output parameter.
151 SCI_STATUS scic_port_get_properties(
152 SCI_PORT_HANDLE_T port,
153 SCIC_PORT_PROPERTIES_T * properties
157 * @brief This method will add a phy to an existing port.
159 * @param[in] port This parameter specifies the port in which to add a new
161 * @param[in] phy This parameter specifies the phy to be added to the port.
163 * @return Indicate if the phy was successfully added to the port.
164 * @retval SCI_SUCCESS This value is returned if the phy was successfully
166 * @retval SCI_FAILURE_INVALID_PORT This value is returned if the supplied
168 * @retval SCI_FAILURE_INVALID_PHY This value is returned if the supplied
169 * phy is either invalid or already contained in another port.
171 SCI_STATUS scic_port_add_phy(
172 SCI_PORT_HANDLE_T port,
177 * @brief This method will remove a phy from an existing port.
179 * @param[in] port This parameter specifies the port in which to remove a
181 * @param[in] phy This parameter specifies the phy to be removed from the
184 * @return Indicate if the phy was successfully removed from the port.
185 * @retval SCI_SUCCESS This value is returned if the phy was successfully
186 * removed from the port.
187 * @retval SCI_FAILURE_INVALID_PORT This value is returned if the supplied
189 * @retval SCI_FAILURE_INVALID_PHY This value is returned if the supplied
190 * phy is either invalid or
191 * not contained in the port.
193 SCI_STATUS scic_port_remove_phy(
194 SCI_PORT_HANDLE_T port,
199 * @brief This method will request the SCI implementation to perform a
200 * HARD RESET on the SAS Port. If/When the HARD RESET completes
201 * the SCI user will be notified via an SCI OS callback indicating
202 * a direct attached device was found.
204 * @note The SCI User callback in SCIC_USER_CALLBACKS_T will only be called
205 * once for each phy in the SAS Port at completion of the hard reset
208 * @param[in] port a handle corresponding to the SAS port to be
210 * @param[in] reset_timeout This parameter specifies the number of
211 * milliseconds in which the port reset operation should complete.
213 * @return Return a status indicating whether the hard reset started
215 * @retval SCI_SUCCESS This value is returned if the hard reset operation
216 * started successfully.
218 SCI_STATUS scic_port_hard_reset(
219 SCI_PORT_HANDLE_T port,
224 * @brief This API method enables the broadcast change notification from
225 * underneath hardware.
227 * @param[in] port The port upon which broadcast change notifications
228 * (BCN) are to be enabled.
232 void scic_port_enable_broadcast_change_notification(
233 SCI_PORT_HANDLE_T port
238 #endif // __cplusplus
240 #endif // _SCIC_PORT_H_