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
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 * @brief This file contains all of the interface methods that can be called
61 * by an SCIC user on a phy (SAS or SATA) object.
68 #include <dev/isci/scil/sci_types.h>
69 #include <dev/isci/scil/sci_status.h>
71 #include <dev/isci/scil/intel_sata.h>
72 #include <dev/isci/scil/intel_sas.h>
76 * @struct SCIC_PHY_PROPERTIES
77 * @brief This structure defines the properties common to all phys
78 * that can be retrieved.
80 typedef struct SCIC_PHY_PROPERTIES
83 * This field specifies the port that currently contains the
84 * supplied phy. This field may be set to SCI_INVALID_HANDLE
85 * if the phy is not currently contained in a port.
87 SCI_PORT_HANDLE_T owning_port;
90 * This field specifies the maximum link rate for which this phy
93 SCI_SAS_LINK_RATE max_link_rate;
96 * This field specifies the link rate at which the phy is
97 * currently operating.
99 SCI_SAS_LINK_RATE negotiated_link_rate;
102 * This field indicates the identify address frame that will be
103 * transmitted to the connected phy.
105 SCI_SAS_IDENTIFY_ADDRESS_FRAME_T transmit_iaf;
108 * This field specifies the index of the phy in relation to other
109 * phys within the controller. This index is zero relative.
113 } SCIC_PHY_PROPERTIES_T;
116 * @struct SCIC_SAS_PHY_PROPERTIES
117 * @brief This structure defines the properties, specific to a
118 * SAS phy, that can be retrieved.
120 typedef struct SCIC_SAS_PHY_PROPERTIES
123 * This field delineates the Identify Address Frame received
124 * from the remote end point.
126 SCI_SAS_IDENTIFY_ADDRESS_FRAME_T received_iaf;
129 * This field delineates the Phy capabilities structure received
130 * from the remote end point.
132 SAS_CAPABILITIES_T received_capabilities;
134 } SCIC_SAS_PHY_PROPERTIES_T;
137 * @struct SCIC_SATA_PHY_PROPERTIES
138 * @brief This structure defines the properties, specific to a
139 * SATA phy, that can be retrieved.
141 typedef struct SCIC_SATA_PHY_PROPERTIES
144 * This field delineates the signature FIS received from the
147 SATA_FIS_REG_D2H_T signature_fis;
150 * This field specifies to the user if a port selector is connected
151 * on the specified phy.
153 BOOL is_port_selector_present;
155 } SCIC_SATA_PHY_PROPERTIES_T;
158 * @enum SCIC_PHY_COUNTER_ID
159 * @brief This enumeration depicts the various pieces of optional
160 * information that can be retrieved for a specific phy.
162 typedef enum SCIC_PHY_COUNTER_ID
165 * This PHY information field tracks the number of frames received.
167 SCIC_PHY_COUNTER_RECEIVED_FRAME,
170 * This PHY information field tracks the number of frames transmitted.
172 SCIC_PHY_COUNTER_TRANSMITTED_FRAME,
175 * This PHY information field tracks the number of DWORDs received.
177 SCIC_PHY_COUNTER_RECEIVED_FRAME_DWORD,
180 * This PHY information field tracks the number of DWORDs transmitted.
182 SCIC_PHY_COUNTER_TRANSMITTED_FRAME_DWORD,
185 * This PHY information field tracks the number of times DWORD
186 * synchronization was lost.
188 SCIC_PHY_COUNTER_LOSS_OF_SYNC_ERROR,
191 * This PHY information field tracks the number of received DWORDs with
192 * running disparity errors.
194 SCIC_PHY_COUNTER_RECEIVED_DISPARITY_ERROR,
197 * This PHY information field tracks the number of received frames with a
198 * CRC error (not including short or truncated frames).
200 SCIC_PHY_COUNTER_RECEIVED_FRAME_CRC_ERROR,
203 * This PHY information field tracks the number of DONE (ACK/NAK TIMEOUT)
204 * primitives received.
206 SCIC_PHY_COUNTER_RECEIVED_DONE_ACK_NAK_TIMEOUT,
209 * This PHY information field tracks the number of DONE (ACK/NAK TIMEOUT)
210 * primitives transmitted.
212 SCIC_PHY_COUNTER_TRANSMITTED_DONE_ACK_NAK_TIMEOUT,
215 * This PHY information field tracks the number of times the inactivity
216 * timer for connections on the phy has been utilized.
218 SCIC_PHY_COUNTER_INACTIVITY_TIMER_EXPIRED,
221 * This PHY information field tracks the number of DONE (CREDIT TIMEOUT)
222 * primitives received.
224 SCIC_PHY_COUNTER_RECEIVED_DONE_CREDIT_TIMEOUT,
227 * This PHY information field tracks the number of DONE (CREDIT TIMEOUT)
228 * primitives transmitted.
230 SCIC_PHY_COUNTER_TRANSMITTED_DONE_CREDIT_TIMEOUT,
233 * This PHY information field tracks the number of CREDIT BLOCKED
234 * primitives received.
235 * @note Depending on remote device implementation, credit blocks
236 * may occur regularly.
238 SCIC_PHY_COUNTER_RECEIVED_CREDIT_BLOCKED,
241 * This PHY information field contains the number of short frames
242 * received. A short frame is simply a frame smaller then what is
243 * allowed by either the SAS or SATA specification.
245 SCIC_PHY_COUNTER_RECEIVED_SHORT_FRAME,
248 * This PHY information field contains the number of frames received after
249 * credit has been exhausted.
251 SCIC_PHY_COUNTER_RECEIVED_FRAME_WITHOUT_CREDIT,
254 * This PHY information field contains the number of frames received after
255 * a DONE has been received.
257 SCIC_PHY_COUNTER_RECEIVED_FRAME_AFTER_DONE,
260 * This PHY information field contains the number of times the phy
261 * failed to achieve DWORD synchronization during speed negotiation.
263 SCIC_PHY_COUNTER_SN_DWORD_SYNC_ERROR
264 } SCIC_PHY_COUNTER_ID_T;
267 * @brief This method will enable the user to retrieve information
268 * common to all phys, such as: the negotiated link rate,
271 * @param[in] phy This parameter specifies the phy for which to retrieve
273 * @param[out] properties This parameter specifies the properties
274 * structure into which to copy the requested information.
276 * @return Indicate if the user specified a valid phy.
277 * @retval SCI_SUCCESS This value is returned if the specified phy was valid.
278 * @retval SCI_FAILURE_INVALID_PHY This value is returned if the specified phy
279 * is not valid. When this value is returned, no data is copied to the
280 * properties output parameter.
282 SCI_STATUS scic_phy_get_properties(
283 SCI_PHY_HANDLE_T phy,
284 SCIC_PHY_PROPERTIES_T * properties
288 * @brief This method will enable the user to retrieve information
289 * specific to a SAS phy, such as: the received identify
290 * address frame, received phy capabilities, etc.
292 * @param[in] phy this parameter specifies the phy for which to
293 * retrieve properties.
294 * @param[out] properties This parameter specifies the properties
295 * structure into which to copy the requested information.
297 * @return This method returns an indication as to whether the SAS
298 * phy properties were successfully retrieved.
299 * @retval SCI_SUCCESS This value is returned if the SAS properties
300 * are successfully retrieved.
301 * @retval SCI_FAILURE This value is returned if the SAS properties
302 * are not successfully retrieved (e.g. It's not a SAS Phy).
304 SCI_STATUS scic_sas_phy_get_properties(
305 SCI_PHY_HANDLE_T phy,
306 SCIC_SAS_PHY_PROPERTIES_T * properties
310 * @brief This method will enable the user to retrieve information
311 * specific to a SATA phy, such as: the recieved signature
312 * FIS, if a port selector is present, etc.
314 * @param[in] phy this parameter specifies the phy for which to
315 * retrieve properties.
316 * @param[out] properties This parameter specifies the properties
317 * structure into which to copy the requested information.
319 * @return This method returns an indication as to whether the SATA
320 * phy properties were successfully retrieved.
321 * @retval SCI_SUCCESS This value is returned if the SATA properties
322 * are successfully retrieved.
323 * @retval SCI_FAILURE This value is returned if the SATA properties
324 * are not successfully retrieved (e.g. It's not a SATA Phy).
326 SCI_STATUS scic_sata_phy_get_properties(
327 SCI_PHY_HANDLE_T phy,
328 SCIC_SATA_PHY_PROPERTIES_T * properties
332 * @brief This method allows the SCIC user to instruct the SCIC
333 * implementation to send the SATA port selection signal.
335 * @param[in] phy this parameter specifies the phy for which to send
336 * the port selection signal.
338 * @return An indication of whether the port selection signal was
339 * successfully executed.
340 * @retval SCI_SUCCESS This value is returned if the port selection signal
341 * was successfully transmitted.
343 SCI_STATUS scic_sata_phy_send_port_selection_signal(
348 * @brief This method requests the SCI implementation to begin tracking
349 * information specified by the supplied parameters.
351 * @param[in] phy this parameter specifies the phy for which to enable
352 * the information type.
353 * @param[in] counter_id this parameter specifies the information
354 * type to be enabled.
356 * @return Indicate if enablement of the information type was successful.
357 * @retval SCI_SUCCESS This value is returned if the information type was
358 * successfully enabled.
359 * @retval SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD This value is returned
360 * if the supplied information type is not supported.
362 SCI_STATUS scic_phy_enable_counter(
363 SCI_PHY_HANDLE_T phy,
364 SCIC_PHY_COUNTER_ID_T counter_id
368 * @brief This method requests the SCI implementation to stop tracking
369 * information specified by the supplied parameters.
371 * @param[in] phy this parameter specifies the phy for which to disable
372 * the information type.
373 * @param[in] counter_id this parameter specifies the information
374 * type to be disabled.
376 * @return Indicate if disablement of the information type was successful.
377 * @retval SCI_SUCCESS This value is returned if the information type was
378 * successfully disabled.
379 * @retval SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD This value is returned
380 * if the supplied information type is not supported.
382 SCI_STATUS scic_phy_disable_counter(
383 SCI_PHY_HANDLE_T phy,
384 SCIC_PHY_COUNTER_ID_T counter_id
388 * @brief This method requests the SCI implementation to retrieve
389 * tracking information specified by the supplied parameters.
391 * @param[in] phy this parameter specifies the phy for which to retrieve
392 * the information type.
393 * @param[in] counter_id this parameter specifies the information
394 * type to be retrieved.
395 * @param[out] data this parameter is a 32-bit pointer to a location
396 * where the data being retrieved is to be placed.
398 * @return Indicate if retrieval of the information type was successful.
399 * @retval SCI_SUCCESS This value is returned if the information type was
400 * successfully retrieved.
401 * @retval SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD This value is returned
402 * if the supplied information type is not supported.
404 SCI_STATUS scic_phy_get_counter(
405 SCI_PHY_HANDLE_T phy,
406 SCIC_PHY_COUNTER_ID_T counter_id,
411 * @brief This method requests the SCI implementation to clear (reset)
412 * tracking information specified by the supplied parameters.
414 * @param[in] phy this parameter specifies the phy for which to clear
415 * the information type.
416 * @param[in] counter_id this parameter specifies the information
417 * type to be cleared.
419 * @return Indicate if clearing of the information type was successful.
420 * @retval SCI_SUCCESS This value is returned if the information type was
421 * successfully cleared.
422 * @retval SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD This value is returned
423 * if the supplied information type is not supported.
425 SCI_STATUS scic_phy_clear_counter(
426 SCI_PHY_HANDLE_T phy,
427 SCIC_PHY_COUNTER_ID_T counter_id
431 * @brief This method will attempt to stop the phy object.
433 * @param[in] this_phy
436 * @retval SCI_SUCCESS if the phy is going to stop
437 * SCI_INVALID_STATE if the phy is not in a valid state
440 SCI_STATUS scic_phy_stop(
445 * @brief This method will attempt to start the phy object. This
446 * request is only valid when the phy is in the stopped
449 * @param[in] this_phy
453 SCI_STATUS scic_phy_start(
459 #endif // __cplusplus
461 #endif // _SCIC_PHY_H_