1f11c7f63SJim Harris /*- 2718cf2ccSPedro F. Giffuni * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 3718cf2ccSPedro 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_USER_CALLBACK_H_ 57f11c7f63SJim Harris #define _SCIC_USER_CALLBACK_H_ 58f11c7f63SJim Harris 59f11c7f63SJim Harris /** 60f11c7f63SJim Harris * @file 61f11c7f63SJim Harris * 62f11c7f63SJim Harris * @brief This file contains all of the interface methods/macros that must 63f11c7f63SJim Harris * be implemented by an SCI Core user. 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/sci_controller.h> 73f11c7f63SJim Harris 74f11c7f63SJim Harris /** 75f11c7f63SJim Harris * @brief This callback method asks the user to create a timer and provide 76f11c7f63SJim Harris * a handle for this timer for use in further timer interactions. 77f11c7f63SJim Harris * 78f11c7f63SJim Harris * @warning The "timer_callback" method should be executed in a mutually 79*2dfcc3a9SGordon Bergling * exclusive manner from the controller completion handler 80f11c7f63SJim Harris * handler (refer to scic_controller_get_handler_methods()). 81f11c7f63SJim Harris * 82f11c7f63SJim Harris * @param[in] controller This parameter specifies the controller with 83f11c7f63SJim Harris * which this timer is to be associated. 84f11c7f63SJim Harris * @param[in] timer_callback This parameter specifies the callback method 85f11c7f63SJim Harris * to be invoked whenever the timer expires. 86f11c7f63SJim Harris * @param[in] cookie This parameter specifies a piece of information that 87f11c7f63SJim Harris * the user must retain. This cookie is to be supplied by the 88f11c7f63SJim Harris * user anytime a timeout occurs for the created timer. 89f11c7f63SJim Harris * 90f11c7f63SJim Harris * @return This method returns a handle to a timer object created by the 91f11c7f63SJim Harris * user. The handle will be utilized for all further interactions 92f11c7f63SJim Harris * relating to this timer. 93f11c7f63SJim Harris */ 94f11c7f63SJim Harris void * scic_cb_timer_create( 95f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 96f11c7f63SJim Harris SCI_TIMER_CALLBACK_T timer_callback, 97f11c7f63SJim Harris void * cookie 98f11c7f63SJim Harris ); 99f11c7f63SJim Harris 100f11c7f63SJim Harris /** 101453130d9SPedro F. Giffuni * @brief This callback method asks the user to destroy the supplied timer. 102f11c7f63SJim Harris * 103f11c7f63SJim Harris * @param[in] controller This parameter specifies the controller with 104f11c7f63SJim Harris * which this timer is to associated. 105f11c7f63SJim Harris * @param[in] timer This parameter specifies the timer to be destroyed. 106f11c7f63SJim Harris * 107f11c7f63SJim Harris * @return none 108f11c7f63SJim Harris */ 109f11c7f63SJim Harris void scic_cb_timer_destroy( 110f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 111f11c7f63SJim Harris void * timer 112f11c7f63SJim Harris ); 113f11c7f63SJim Harris 114f11c7f63SJim Harris /** 115f11c7f63SJim Harris * @brief This callback method asks the user to start the supplied timer. 116f11c7f63SJim Harris * 117f11c7f63SJim Harris * @warning All timers in the system started by the SCI Core are one shot 118f11c7f63SJim Harris * timers. Therefore, the SCI user should make sure that it 119f11c7f63SJim Harris * removes the timer from it's list when a timer actually fires. 120f11c7f63SJim Harris * Additionally, SCI Core user's should be able to handle 121f11c7f63SJim Harris * calls from the SCI Core to stop a timer that may already 122f11c7f63SJim Harris * be stopped. 123f11c7f63SJim Harris * 124f11c7f63SJim Harris * @param[in] controller This parameter specifies the controller with 125f11c7f63SJim Harris * which this timer is to associated. 126f11c7f63SJim Harris * @param[in] timer This parameter specifies the timer to be started. 127f11c7f63SJim Harris * @param[in] milliseconds This parameter specifies the number of 128f11c7f63SJim Harris * milliseconds for which to stall. The operating system driver 129f11c7f63SJim Harris * is allowed to round this value up where necessary. 130f11c7f63SJim Harris * 131f11c7f63SJim Harris * @return none 132f11c7f63SJim Harris */ 133f11c7f63SJim Harris void scic_cb_timer_start( 134f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 135f11c7f63SJim Harris void * timer, 136f11c7f63SJim Harris U32 milliseconds 137f11c7f63SJim Harris ); 138f11c7f63SJim Harris 139f11c7f63SJim Harris /** 140f11c7f63SJim Harris * @brief This callback method asks the user to stop the supplied timer. 141f11c7f63SJim Harris * 142f11c7f63SJim Harris * @param[in] controller This parameter specifies the controller with 143f11c7f63SJim Harris * which this timer is to associated. 144f11c7f63SJim Harris * @param[in] timer This parameter specifies the timer to be stopped. 145f11c7f63SJim Harris * 146f11c7f63SJim Harris * @return none 147f11c7f63SJim Harris */ 148f11c7f63SJim Harris void scic_cb_timer_stop( 149f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 150f11c7f63SJim Harris void * timer 151f11c7f63SJim Harris ); 152f11c7f63SJim Harris 153f11c7f63SJim Harris /** 154f11c7f63SJim Harris * @brief This method is called when the core requires the OS driver 155f11c7f63SJim Harris * to stall execution. This method is utilized during initialization 156f11c7f63SJim Harris * or non-performance paths only. 157f11c7f63SJim Harris * 158f11c7f63SJim Harris * @param[in] microseconds This parameter specifies the number of 159f11c7f63SJim Harris * microseconds for which to stall. The operating system driver 160f11c7f63SJim Harris * is allowed to round this value up where necessary. 161f11c7f63SJim Harris * 162f11c7f63SJim Harris * @return none. 163f11c7f63SJim Harris */ 164f11c7f63SJim Harris void scic_cb_stall_execution( 165f11c7f63SJim Harris U32 microseconds 166f11c7f63SJim Harris ); 167f11c7f63SJim Harris 168f11c7f63SJim Harris /** 169f11c7f63SJim Harris * @brief This user callback will inform the user that the controller has 170f11c7f63SJim Harris * finished the start process. 171f11c7f63SJim Harris * 172f11c7f63SJim Harris * @param[in] controller This parameter specifies the controller that was 173f11c7f63SJim Harris * started. 174f11c7f63SJim Harris * @param[in] completion_status This parameter specifies the results of 175f11c7f63SJim Harris * the start operation. SCI_SUCCESS indicates successful 176f11c7f63SJim Harris * completion. 177f11c7f63SJim Harris * 178f11c7f63SJim Harris * @return none 179f11c7f63SJim Harris */ 180f11c7f63SJim Harris void scic_cb_controller_start_complete( 181f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 182f11c7f63SJim Harris SCI_STATUS completion_status 183f11c7f63SJim Harris ); 184f11c7f63SJim Harris 185f11c7f63SJim Harris /** 186f11c7f63SJim Harris * @brief This user callback will inform the user that the controller has 187f11c7f63SJim Harris * finished the stop process. 188f11c7f63SJim Harris * 189f11c7f63SJim Harris * @param[in] controller This parameter specifies the controller that was 190f11c7f63SJim Harris * stopped. 191f11c7f63SJim Harris * @param[in] completion_status This parameter specifies the results of 192f11c7f63SJim Harris * the stop operation. SCI_SUCCESS indicates successful 193f11c7f63SJim Harris * completion. 194f11c7f63SJim Harris * 195f11c7f63SJim Harris * @return none 196f11c7f63SJim Harris */ 197f11c7f63SJim Harris void scic_cb_controller_stop_complete( 198f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 199f11c7f63SJim Harris SCI_STATUS completion_status 200f11c7f63SJim Harris ); 201f11c7f63SJim Harris 202f11c7f63SJim Harris /** 203f11c7f63SJim Harris * @brief This user callback will inform the user that an IO request has 204f11c7f63SJim Harris * completed. 205f11c7f63SJim Harris * 206f11c7f63SJim Harris * @param[in] controller This parameter specifies the controller on 207f11c7f63SJim Harris * which the IO is completing. 208f11c7f63SJim Harris * @param[in] remote_device This parameter specifies the remote device on 209f11c7f63SJim Harris * which this IO request is completing. 210f11c7f63SJim Harris * @param[in] io_request This parameter specifies the IO request that has 211f11c7f63SJim Harris * completed. 212f11c7f63SJim Harris * @param[in] completion_status This parameter specifies the results of 213f11c7f63SJim Harris * the IO request operation. SCI_SUCCESS indicates successful 214f11c7f63SJim Harris * completion. 215f11c7f63SJim Harris * 216f11c7f63SJim Harris * @return none 217f11c7f63SJim Harris */ 218f11c7f63SJim Harris void scic_cb_io_request_complete( 219f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 220f11c7f63SJim Harris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 221f11c7f63SJim Harris SCI_IO_REQUEST_HANDLE_T io_request, 222f11c7f63SJim Harris SCI_IO_STATUS completion_status 223f11c7f63SJim Harris ); 224f11c7f63SJim Harris 225f11c7f63SJim Harris /** 226f11c7f63SJim Harris * @brief This method simply returns the virtual address associated 227f11c7f63SJim Harris * with the scsi_io and byte_offset supplied parameters. 228f11c7f63SJim Harris * 229f11c7f63SJim Harris * @note This callback is not utilized in the fast path. The expectation 230f11c7f63SJim Harris * is that this method is utilized for items such as SCSI to ATA 231f11c7f63SJim Harris * translation for commands like INQUIRY, READ CAPACITY, etc. 232f11c7f63SJim Harris * 233f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 234f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 235f11c7f63SJim Harris * provide the necessary information for this callback. 236f11c7f63SJim Harris * @param[in] byte_offset This parameter specifies the offset into the data 237f11c7f63SJim Harris * buffers pointed to by the SGL. The byte offset starts at 0 238f11c7f63SJim Harris * and continues until the last byte pointed to be the last SGL 239f11c7f63SJim Harris * element. 240f11c7f63SJim Harris * 241f11c7f63SJim Harris * @return A virtual address pointer to the location specified by the 242f11c7f63SJim Harris * parameters. 243f11c7f63SJim Harris */ 244f11c7f63SJim Harris U8 *scic_cb_io_request_get_virtual_address_from_sgl( 245f11c7f63SJim Harris void * scic_user_io_request, 246f11c7f63SJim Harris U32 byte_offset 247f11c7f63SJim Harris ); 248f11c7f63SJim Harris 249f11c7f63SJim Harris /** 250f11c7f63SJim Harris * @brief This user callback will inform the user that a task management 251f11c7f63SJim Harris * request completed. 252f11c7f63SJim Harris * 253f11c7f63SJim Harris * @param[in] controller This parameter specifies the controller on 254f11c7f63SJim Harris * which the task management request is completing. 255f11c7f63SJim Harris * @param[in] remote_device This parameter specifies the remote device on 256f11c7f63SJim Harris * which this task management request is completing. 257f11c7f63SJim Harris * @param[in] task_request This parameter specifies the task management 258f11c7f63SJim Harris * request that has completed. 259f11c7f63SJim Harris * @param[in] completion_status This parameter specifies the results of 260f11c7f63SJim Harris * the IO request operation. SCI_SUCCESS indicates successful 261f11c7f63SJim Harris * completion. 262f11c7f63SJim Harris * 263f11c7f63SJim Harris * @return none 264f11c7f63SJim Harris */ 265f11c7f63SJim Harris void scic_cb_task_request_complete( 266f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 267f11c7f63SJim Harris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 268f11c7f63SJim Harris SCI_TASK_REQUEST_HANDLE_T task_request, 269f11c7f63SJim Harris SCI_TASK_STATUS completion_status 270f11c7f63SJim Harris ); 271f11c7f63SJim Harris 272f11c7f63SJim Harris #ifndef SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED 273f11c7f63SJim Harris /** 274f11c7f63SJim Harris * @brief This callback method asks the user to provide the physical 275f11c7f63SJim Harris * address for the supplied virtual address when building an 276f11c7f63SJim Harris * io request object. 277f11c7f63SJim Harris * 278f11c7f63SJim Harris * @param[in] controller This parameter is the core controller object 279f11c7f63SJim Harris * handle. 280f11c7f63SJim Harris * @param[in] io_request This parameter is the io request object handle 281f11c7f63SJim Harris * for which the physical address is being requested. 282453130d9SPedro F. Giffuni * @param[in] virtual_address This parameter is the virtual address which 283f11c7f63SJim Harris * is to be returned as a physical address. 284f11c7f63SJim Harris * @param[out] physical_address The physical address for the supplied virtual 285f11c7f63SJim Harris * address. 286f11c7f63SJim Harris * 287f11c7f63SJim Harris * @return None. 288f11c7f63SJim Harris */ 289f11c7f63SJim Harris void scic_cb_io_request_get_physical_address( 290f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 291f11c7f63SJim Harris SCI_IO_REQUEST_HANDLE_T io_request, 292f11c7f63SJim Harris void * virtual_address, 293f11c7f63SJim Harris SCI_PHYSICAL_ADDRESS * physical_address 294f11c7f63SJim Harris ); 295f11c7f63SJim Harris #endif // SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED 296f11c7f63SJim Harris 297f11c7f63SJim Harris /** 298f11c7f63SJim Harris * @brief This callback method asks the user to provide the number of 299453130d9SPedro F. Giffuni * bytes to be transferred as part of this request. 300f11c7f63SJim Harris * 301f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 302f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 303f11c7f63SJim Harris * provide the necessary information for this callback. 304f11c7f63SJim Harris * 305f11c7f63SJim Harris * @return This method returns the number of payload data bytes to be 306453130d9SPedro F. Giffuni * transferred for this IO request. 307f11c7f63SJim Harris */ 308f11c7f63SJim Harris U32 scic_cb_io_request_get_transfer_length( 309f11c7f63SJim Harris void * scic_user_io_request 310f11c7f63SJim Harris ); 311f11c7f63SJim Harris 312f11c7f63SJim Harris /** 313f11c7f63SJim Harris * @brief This callback method asks the user to provide the data direction 314f11c7f63SJim Harris * for this request. 315f11c7f63SJim Harris * 316f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 317f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 318f11c7f63SJim Harris * provide the necessary information for this callback. 319f11c7f63SJim Harris * 320f11c7f63SJim Harris * @return This method returns the value of SCI_IO_REQUEST_DATA_OUT or 321f11c7f63SJim Harris * SCI_IO_REQUEST_DATA_IN, or SCI_IO_REQUEST_NO_DATA. 322f11c7f63SJim Harris */ 323f11c7f63SJim Harris SCI_IO_REQUEST_DATA_DIRECTION scic_cb_io_request_get_data_direction( 324f11c7f63SJim Harris void * scic_user_io_request 325f11c7f63SJim Harris ); 326f11c7f63SJim Harris 327f11c7f63SJim Harris #ifdef ENABLE_OSSL_COPY_BUFFER 328f11c7f63SJim Harris /** 329f11c7f63SJim Harris * @brief This method is presently utilized in the PIO path, 330f11c7f63SJim Harris * copies from UF buffer to the SGL buffer. This method 331f11c7f63SJim Harris * can be served for other OS related copies. 332f11c7f63SJim Harris * 333f11c7f63SJim Harris * @param[in] scic_user_io_request. This parameter points to the user's 334f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 335f11c7f63SJim Harris * provide the necessary information for this callback. 336f11c7f63SJim Harris * @param[in] source addr. Address of UF buffer. 337f11c7f63SJim Harris * @param[in] offset. This parameter specifies the offset into the data 338f11c7f63SJim Harris * buffers pointed to by the SGL. The byte offset starts at 0 339f11c7f63SJim Harris * and continues until the last byte pointed to be the last SGL 340f11c7f63SJim Harris * element. 341f11c7f63SJim Harris * @param[in] length. data length 342f11c7f63SJim Harris * 343f11c7f63SJim Harris * @return None 344f11c7f63SJim Harris */ 345f11c7f63SJim Harris void scic_cb_io_request_copy_buffer( 346f11c7f63SJim Harris void * scic_user_io_request, 347f11c7f63SJim Harris U8 *source_addr, 348f11c7f63SJim Harris U32 offset, 349f11c7f63SJim Harris U32 length 350f11c7f63SJim Harris ); 351f11c7f63SJim Harris #endif 352f11c7f63SJim Harris 353f11c7f63SJim Harris #ifndef SCI_SGL_OPTIMIZATION_ENABLED 354f11c7f63SJim Harris /** 355f11c7f63SJim Harris * @brief This callback method asks the user to provide the address 356f11c7f63SJim Harris * to where the next Scatter-Gather Element is located. 357f11c7f63SJim Harris * 358f11c7f63SJim Harris * Details regarding usage: 359f11c7f63SJim Harris * - Regarding the first SGE: the user should initialize an index, 360f11c7f63SJim Harris * or a pointer, prior to construction of the request that will 361f11c7f63SJim Harris * reference the very first scatter-gather element. This is 362f11c7f63SJim Harris * important since this method is called for every scatter-gather 363f11c7f63SJim Harris * element, including the first element. 364f11c7f63SJim Harris * - Regarding the last SGE: the user should return NULL from this 365f11c7f63SJim Harris * method when this method is called and the SGL has exhausted 366f11c7f63SJim Harris * all elements. 367f11c7f63SJim Harris * 368f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 369f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 370f11c7f63SJim Harris * provide the necessary information for this callback. 371f11c7f63SJim Harris * @param[in] current_sge_address This parameter specifies the address for 372f11c7f63SJim Harris * the current SGE (i.e. the one that has just processed). 373f11c7f63SJim Harris * @param[out] next_sge An address specifying the location for the next 374f11c7f63SJim Harris * scatter gather element to be processed. 375f11c7f63SJim Harris * 376f11c7f63SJim Harris * @return None 377f11c7f63SJim Harris */ 378f11c7f63SJim Harris void scic_cb_io_request_get_next_sge( 379f11c7f63SJim Harris void * scic_user_io_request, 380f11c7f63SJim Harris void * current_sge_address, 381f11c7f63SJim Harris void ** next_sge 382f11c7f63SJim Harris ); 383f11c7f63SJim Harris #endif // SCI_SGL_OPTIMIZATION_ENABLED 384f11c7f63SJim Harris 385f11c7f63SJim Harris /** 386f11c7f63SJim Harris * @brief This callback method asks the user to provide the contents of the 387f11c7f63SJim Harris * "address" field in the Scatter-Gather Element. 388f11c7f63SJim Harris * 389f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 390f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 391f11c7f63SJim Harris * provide the necessary information for this callback. 392f11c7f63SJim Harris * @param[in] sge_address This parameter specifies the address for the 393f11c7f63SJim Harris * SGE from which to retrieve the address field. 394f11c7f63SJim Harris * 395f11c7f63SJim Harris * @return A physical address specifying the contents of the SGE's address 396f11c7f63SJim Harris * field. 397f11c7f63SJim Harris */ 398f11c7f63SJim Harris SCI_PHYSICAL_ADDRESS scic_cb_sge_get_address_field( 399f11c7f63SJim Harris void * scic_user_io_request, 400f11c7f63SJim Harris void * sge_address 401f11c7f63SJim Harris ); 402f11c7f63SJim Harris 403f11c7f63SJim Harris /** 404f11c7f63SJim Harris * @brief This callback method asks the user to provide the contents of the 405f11c7f63SJim Harris * "length" field in the Scatter-Gather Element. 406f11c7f63SJim Harris * 407f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 408f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 409f11c7f63SJim Harris * provide the necessary information for this callback. 410f11c7f63SJim Harris * @param[in] sge_address This parameter specifies the address for the 411f11c7f63SJim Harris * SGE from which to retrieve the address field. 412f11c7f63SJim Harris * 413f11c7f63SJim Harris * @return This method returns the length field specified inside the SGE 414f11c7f63SJim Harris * referenced by the sge_address parameter. 415f11c7f63SJim Harris */ 416f11c7f63SJim Harris U32 scic_cb_sge_get_length_field( 417f11c7f63SJim Harris void * scic_user_io_request, 418f11c7f63SJim Harris void * sge_address 419f11c7f63SJim Harris ); 420f11c7f63SJim Harris 421f11c7f63SJim Harris /** 422f11c7f63SJim Harris * @brief This callback method asks the user to provide the address for 423f11c7f63SJim Harris * the command descriptor block (CDB) associated with this IO request. 424f11c7f63SJim Harris * 425f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 426f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 427f11c7f63SJim Harris * provide the necessary information for this callback. 428f11c7f63SJim Harris * 429f11c7f63SJim Harris * @return This method returns the virtual address of the CDB. 430f11c7f63SJim Harris */ 431f11c7f63SJim Harris void * scic_cb_ssp_io_request_get_cdb_address( 432f11c7f63SJim Harris void * scic_user_io_request 433f11c7f63SJim Harris ); 434f11c7f63SJim Harris 435f11c7f63SJim Harris /** 436f11c7f63SJim Harris * @brief This callback method asks the user to provide the length of 437f11c7f63SJim Harris * the command descriptor block (CDB) associated with this IO request. 438f11c7f63SJim Harris * 439f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 440f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 441f11c7f63SJim Harris * provide the necessary information for this callback. 442f11c7f63SJim Harris * 443f11c7f63SJim Harris * @return This method returns the length of the CDB. 444f11c7f63SJim Harris */ 445f11c7f63SJim Harris U32 scic_cb_ssp_io_request_get_cdb_length( 446f11c7f63SJim Harris void * scic_user_io_request 447f11c7f63SJim Harris ); 448f11c7f63SJim Harris 449f11c7f63SJim Harris /** 450f11c7f63SJim Harris * @brief This callback method asks the user to provide the Logical Unit (LUN) 451f11c7f63SJim Harris * associated with this IO request. 452f11c7f63SJim Harris * 453f11c7f63SJim Harris * @note The contents of the value returned from this callback are defined 454f11c7f63SJim Harris * by the protocol standard (e.g. T10 SAS specification). Please 455f11c7f63SJim Harris * refer to the transport command information unit description 456f11c7f63SJim Harris * in the associated standard. 457f11c7f63SJim Harris * 458f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 459f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 460f11c7f63SJim Harris * provide the necessary information for this callback. 461f11c7f63SJim Harris * 462f11c7f63SJim Harris * @return This method returns the LUN associated with this request. 463f11c7f63SJim Harris * @todo This should be U64? 464f11c7f63SJim Harris */ 465f11c7f63SJim Harris U32 scic_cb_ssp_io_request_get_lun( 466f11c7f63SJim Harris void * scic_user_io_request 467f11c7f63SJim Harris ); 468f11c7f63SJim Harris 469f11c7f63SJim Harris /** 470f11c7f63SJim Harris * @brief This callback method asks the user to provide the task attribute 471f11c7f63SJim Harris * associated with this IO request. 472f11c7f63SJim Harris * 473f11c7f63SJim Harris * @note The contents of the value returned from this callback are defined 474f11c7f63SJim Harris * by the protocol standard (e.g. T10 SAS specification). Please 475f11c7f63SJim Harris * refer to the transport command information unit description 476f11c7f63SJim Harris * in the associated standard. 477f11c7f63SJim Harris * 478f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 479f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 480f11c7f63SJim Harris * provide the necessary information for this callback. 481f11c7f63SJim Harris * 482f11c7f63SJim Harris * @return This method returns the task attribute associated with this 483f11c7f63SJim Harris * IO request. 484f11c7f63SJim Harris */ 485f11c7f63SJim Harris U32 scic_cb_ssp_io_request_get_task_attribute( 486f11c7f63SJim Harris void * scic_user_io_request 487f11c7f63SJim Harris ); 488f11c7f63SJim Harris 489f11c7f63SJim Harris /** 490f11c7f63SJim Harris * @brief This callback method asks the user to provide the command priority 491f11c7f63SJim Harris * associated with this IO request. 492f11c7f63SJim Harris * 493f11c7f63SJim Harris * @note The contents of the value returned from this callback are defined 494f11c7f63SJim Harris * by the protocol standard (e.g. T10 SAS specification). Please 495f11c7f63SJim Harris * refer to the transport command information unit description 496f11c7f63SJim Harris * in the associated standard. 497f11c7f63SJim Harris * 498f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's 499f11c7f63SJim Harris * IO request object. It is a cookie that allows the user to 500f11c7f63SJim Harris * provide the necessary information for this callback. 501f11c7f63SJim Harris * 502f11c7f63SJim Harris * @return This method returns the command priority associated with this 503f11c7f63SJim Harris * IO request. 504f11c7f63SJim Harris */ 505f11c7f63SJim Harris U32 scic_cb_ssp_io_request_get_command_priority( 506f11c7f63SJim Harris void * scic_user_io_request 507f11c7f63SJim Harris ); 508f11c7f63SJim Harris 509f11c7f63SJim Harris /** 510f11c7f63SJim Harris * @brief This callback method asks the user if the received RX frame data is 511f11c7f63SJim Harris * to be copied to the SGL or should be stored by the SCI core to be 512f11c7f63SJim Harris * retrieved later with the scic_io_request_get_rx_frame(). 513f11c7f63SJim Harris * 514f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's IO 515f11c7f63SJim Harris * request object. It is a cookie that allows the user to provide the 516f11c7f63SJim Harris * necessary information for this callback. 517f11c7f63SJim Harris * 518f11c7f63SJim Harris * @return This method returns TRUE if the SCI core should copy the received 519f11c7f63SJim Harris * frame data to the SGL location or FALSE if the SCI user wants to 520f11c7f63SJim Harris * retrieve the frame data at a later time. 521f11c7f63SJim Harris */ 522f11c7f63SJim Harris BOOL scic_cb_io_request_do_copy_rx_frames( 523f11c7f63SJim Harris void * scic_user_io_request 524f11c7f63SJim Harris ); 525f11c7f63SJim Harris 526f11c7f63SJim Harris /** 527f11c7f63SJim Harris * @brief This callback method asks the user to return the SAT protocol 528f11c7f63SJim Harris * definition for this IO request. This method is only called by the 529f11c7f63SJim Harris * SCI core if the request type constructed is SATA. 530f11c7f63SJim Harris * 531f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's IO 532f11c7f63SJim Harris * request object. It is a cookie that allows the user to provide the 533f11c7f63SJim Harris * necessary information for this callback. 534f11c7f63SJim Harris * 535f11c7f63SJim Harris * @return This method returns one of the sat.h defined protocols for the 536f11c7f63SJim Harris * given io request. 537f11c7f63SJim Harris */ 538f11c7f63SJim Harris U8 scic_cb_request_get_sat_protocol( 539f11c7f63SJim Harris void * scic_user_io_request 540f11c7f63SJim Harris ); 541f11c7f63SJim Harris 542f11c7f63SJim Harris /** 543f11c7f63SJim Harris * @brief This callback method asks the user to indicate if the IO is initially 544f11c7f63SJim Harris * constructed or is reconstructed using the recycled memory. 545f11c7f63SJim Harris * 546f11c7f63SJim Harris * @param[in] scic_user_io_request This parameter points to the user's IO 547f11c7f63SJim Harris * request object. It is a cookie that allows the user to provide the 548f11c7f63SJim Harris * necessary information for this callback. 549f11c7f63SJim Harris * 550f11c7f63SJim Harris * @return This method returns TRUE if the request is initial constructed. 551f11c7f63SJim Harris * This method returns FALSE if the request is constructed using recycled 552f11c7f63SJim Harris * memory. For many scic user, this method mostly always returns TRUE. 553f11c7f63SJim Harris */ 554f11c7f63SJim Harris BOOL scic_cb_request_is_initial_construction( 555f11c7f63SJim Harris void * scic_user_io_request 556f11c7f63SJim Harris ); 557f11c7f63SJim Harris 558f11c7f63SJim Harris /** 559f11c7f63SJim Harris * @brief This method returns the Logical Unit to be utilized for this 560f11c7f63SJim Harris * task management request. 561f11c7f63SJim Harris * 562f11c7f63SJim Harris * @note The contents of the value returned from this callback are defined 563f11c7f63SJim Harris * by the protocol standard (e.g. T10 SAS specification). Please 564f11c7f63SJim Harris * refer to the transport task information unit description 565f11c7f63SJim Harris * in the associated standard. 566f11c7f63SJim Harris * 567f11c7f63SJim Harris * @param[in] scic_user_task_request This parameter points to the user's 568f11c7f63SJim Harris * task request object. It is a cookie that allows the user to 569f11c7f63SJim Harris * provide the necessary information for this callback. 570f11c7f63SJim Harris * 571f11c7f63SJim Harris * @return This method returns the LUN associated with this request. 572f11c7f63SJim Harris * @todo This should be U64? 573f11c7f63SJim Harris */ 574f11c7f63SJim Harris U32 scic_cb_ssp_task_request_get_lun( 575f11c7f63SJim Harris void * scic_user_task_request 576f11c7f63SJim Harris ); 577f11c7f63SJim Harris 578f11c7f63SJim Harris /** 579f11c7f63SJim Harris * @brief This method returns the task management function to be utilized 580f11c7f63SJim Harris * for this task request. 581f11c7f63SJim Harris * 582f11c7f63SJim Harris * @note The contents of the value returned from this callback are defined 583f11c7f63SJim Harris * by the protocol standard (e.g. T10 SAS specification). Please 584f11c7f63SJim Harris * refer to the transport task information unit description 585f11c7f63SJim Harris * in the associated standard. 586f11c7f63SJim Harris * 587f11c7f63SJim Harris * @param[in] scic_user_task_request This parameter points to the user's 588f11c7f63SJim Harris * task request object. It is a cookie that allows the user to 589f11c7f63SJim Harris * provide the necessary information for this callback. 590f11c7f63SJim Harris * 591f11c7f63SJim Harris * @return This method returns an unsigned byte representing the task 592f11c7f63SJim Harris * management function to be performed. 593f11c7f63SJim Harris */ 594f11c7f63SJim Harris U8 scic_cb_ssp_task_request_get_function( 595f11c7f63SJim Harris void * scic_user_task_request 596f11c7f63SJim Harris ); 597f11c7f63SJim Harris 598f11c7f63SJim Harris /** 599f11c7f63SJim Harris * @brief This method returns the task management IO tag to be managed. 600f11c7f63SJim Harris * Depending upon the task management function the value returned 601f11c7f63SJim Harris * from this method may be ignored. 602f11c7f63SJim Harris * 603f11c7f63SJim Harris * @param[in] scic_user_task_request This parameter points to the user's 604f11c7f63SJim Harris * task request object. It is a cookie that allows the user to 605f11c7f63SJim Harris * provide the necessary information for this callback. 606f11c7f63SJim Harris * 607f11c7f63SJim Harris * @return This method returns an unsigned 16-bit word depicting the IO 608f11c7f63SJim Harris * tag to be managed. 609f11c7f63SJim Harris */ 610f11c7f63SJim Harris U16 scic_cb_ssp_task_request_get_io_tag_to_manage( 611f11c7f63SJim Harris void * scic_user_task_request 612f11c7f63SJim Harris ); 613f11c7f63SJim Harris 614f11c7f63SJim Harris /** 615f11c7f63SJim Harris * @brief This callback method asks the user to provide the virtual 616f11c7f63SJim Harris * address of the response data buffer for the supplied IO request. 617f11c7f63SJim Harris * 618f11c7f63SJim Harris * @param[in] scic_user_task_request This parameter points to the user's 619f11c7f63SJim Harris * task request object. It is a cookie that allows the user to 620f11c7f63SJim Harris * provide the necessary information for this callback. 621f11c7f63SJim Harris * 622f11c7f63SJim Harris * @return This method returns the virtual address for the response data buffer 623f11c7f63SJim Harris * associated with this IO request. 624f11c7f63SJim Harris */ 625f11c7f63SJim Harris void * scic_cb_ssp_task_request_get_response_data_address( 626f11c7f63SJim Harris void * scic_user_task_request 627f11c7f63SJim Harris ); 628f11c7f63SJim Harris 629f11c7f63SJim Harris /** 630f11c7f63SJim Harris * @brief This callback method asks the user to provide the length of the 631f11c7f63SJim Harris * response data buffer for the supplied IO request. 632f11c7f63SJim Harris * 633f11c7f63SJim Harris * @param[in] scic_user_task_request This parameter points to the user's 634f11c7f63SJim Harris * task request object. It is a cookie that allows the user to 635f11c7f63SJim Harris * provide the necessary information for this callback. 636f11c7f63SJim Harris * 637f11c7f63SJim Harris * @return This method returns the length of the response buffer data 638f11c7f63SJim Harris * associated with this IO request. 639f11c7f63SJim Harris */ 640f11c7f63SJim Harris U32 scic_cb_ssp_task_request_get_response_data_length( 641f11c7f63SJim Harris void * scic_user_task_request 642f11c7f63SJim Harris ); 643f11c7f63SJim Harris 644f11c7f63SJim Harris /** 645f11c7f63SJim Harris * @brief In this method the user is expected to log the supplied 646f11c7f63SJim Harris * error information. The user must be capable of handling variable 647f11c7f63SJim Harris * length argument lists and should consider prepending the fact 648f11c7f63SJim Harris * that this is an error from the core. 649f11c7f63SJim Harris * 650f11c7f63SJim Harris * @param[in] logger_object This parameter specifies the logger object 651f11c7f63SJim Harris * associated with this message. 652f11c7f63SJim Harris * @param[in] log_object_mask This parameter specifies the log objects 653f11c7f63SJim Harris * for which this message is being generated. 654f11c7f63SJim Harris * @param[in] log_message This parameter specifies the message to be logged. 655f11c7f63SJim Harris * 656f11c7f63SJim Harris * @return none 657f11c7f63SJim Harris */ 658f11c7f63SJim Harris void scic_cb_logger_log_error( 659f11c7f63SJim Harris SCI_LOGGER_HANDLE_T logger_object, 660f11c7f63SJim Harris U32 log_object_mask, 661f11c7f63SJim Harris char * log_message, 662f11c7f63SJim Harris ... 663f11c7f63SJim Harris ); 664f11c7f63SJim Harris 665f11c7f63SJim Harris 666f11c7f63SJim Harris /** 667f11c7f63SJim Harris * @brief In this method the user is expected to log the supplied warning 668f11c7f63SJim Harris * information. The user must be capable of handling variable 669f11c7f63SJim Harris * length argument lists and should consider prepending the fact 670f11c7f63SJim Harris * that this is a warning from the core. 671f11c7f63SJim Harris * 672f11c7f63SJim Harris * @param[in] logger_object This parameter specifies the logger object 673f11c7f63SJim Harris * associated with this message. 674f11c7f63SJim Harris * @param[in] log_object_mask This parameter specifies the log objects 675f11c7f63SJim Harris * for which this message is being generated. 676f11c7f63SJim Harris * @param[in] log_message This parameter specifies the message to be logged. 677f11c7f63SJim Harris * 678f11c7f63SJim Harris * @return none 679f11c7f63SJim Harris */ 680f11c7f63SJim Harris void scic_cb_logger_log_warning( 681f11c7f63SJim Harris SCI_LOGGER_HANDLE_T logger_object, 682f11c7f63SJim Harris U32 log_object_mask, 683f11c7f63SJim Harris char * log_message, 684f11c7f63SJim Harris ... 685f11c7f63SJim Harris ); 686f11c7f63SJim Harris 687f11c7f63SJim Harris 688f11c7f63SJim Harris /** 689f11c7f63SJim Harris * @brief In this method the user is expected to log the supplied debug 690f11c7f63SJim Harris * information. The user must be capable of handling variable 691f11c7f63SJim Harris * length argument lists and should consider prepending the fact 692f11c7f63SJim Harris * that this is a debug message from the core. 693f11c7f63SJim Harris * 694f11c7f63SJim Harris * @param[in] logger_object This parameter specifies the logger object 695f11c7f63SJim Harris * associated with this message. 696f11c7f63SJim Harris * @param[in] log_object_mask This parameter specifies the log objects 697f11c7f63SJim Harris * for which this message is being generated. 698f11c7f63SJim Harris * @param[in] log_message This parameter specifies the message to be logged. 699f11c7f63SJim Harris * 700f11c7f63SJim Harris * @return none 701f11c7f63SJim Harris */ 702f11c7f63SJim Harris void scic_cb_logger_log_info( 703f11c7f63SJim Harris SCI_LOGGER_HANDLE_T logger_object, 704f11c7f63SJim Harris U32 log_object_mask, 705f11c7f63SJim Harris char * log_message, 706f11c7f63SJim Harris ... 707f11c7f63SJim Harris ); 708f11c7f63SJim Harris 709f11c7f63SJim Harris 710f11c7f63SJim Harris /** 711f11c7f63SJim Harris * @brief In this method the user is expected to log the supplied function 712f11c7f63SJim Harris * trace information. The user must be capable of handling variable 713f11c7f63SJim Harris * length argument lists and should consider prepending the fact 714f11c7f63SJim Harris * that this is a function trace (i.e. entry/exit) message from the 715f11c7f63SJim Harris * core. 716f11c7f63SJim Harris * 717f11c7f63SJim Harris * @param[in] logger_object This parameter specifies the logger object 718f11c7f63SJim Harris * associated with this message. 719f11c7f63SJim Harris * @param[in] log_object_mask This parameter specifies the log objects 720f11c7f63SJim Harris * for which this message is being generated. 721f11c7f63SJim Harris * @param[in] log_message This parameter specifies the message to be logged. 722f11c7f63SJim Harris * 723f11c7f63SJim Harris * @return none 724f11c7f63SJim Harris */ 725f11c7f63SJim Harris void scic_cb_logger_log_trace( 726f11c7f63SJim Harris SCI_LOGGER_HANDLE_T logger_object, 727f11c7f63SJim Harris U32 log_object_mask, 728f11c7f63SJim Harris char * log_message, 729f11c7f63SJim Harris ... 730f11c7f63SJim Harris ); 731f11c7f63SJim Harris 732f11c7f63SJim Harris 733f11c7f63SJim Harris /** 734f11c7f63SJim Harris * @brief In this method the user is expected to log the supplied state 735f11c7f63SJim Harris * transition information. The user must be capable of handling 736f11c7f63SJim Harris * variable length argument lists and should consider prepending the 737f11c7f63SJim Harris * fact that this is a warning from the core. 738f11c7f63SJim Harris * 739f11c7f63SJim Harris * @param[in] logger_object This parameter specifies the logger object 740f11c7f63SJim Harris * associated with this message. 741f11c7f63SJim Harris * @param[in] log_object_mask This parameter specifies the log objects 742f11c7f63SJim Harris * for which this message is being generated. 743f11c7f63SJim Harris * @param[in] log_message This parameter specifies the message to be logged. 744f11c7f63SJim Harris * 745f11c7f63SJim Harris * @return none 746f11c7f63SJim Harris */ 747f11c7f63SJim Harris void scic_cb_logger_log_states( 748f11c7f63SJim Harris SCI_LOGGER_HANDLE_T logger_object, 749f11c7f63SJim Harris U32 log_object_mask, 750f11c7f63SJim Harris char * log_message, 751f11c7f63SJim Harris ... 752f11c7f63SJim Harris ); 753f11c7f63SJim Harris 754f11c7f63SJim Harris 755f11c7f63SJim Harris /** 756f11c7f63SJim Harris * @brief In this method the user must return the base address register (BAR) 757f11c7f63SJim Harris * value for the supplied base address register number. 758f11c7f63SJim Harris * 759f11c7f63SJim Harris * @param[in] controller The controller for which to retrieve the bar number. 760f11c7f63SJim Harris * @param[in] bar_number This parameter depicts the BAR index/number to be read. 761f11c7f63SJim Harris * 762f11c7f63SJim Harris * @return Return a pointer value indicating the contents of the BAR. 763f11c7f63SJim Harris * @retval NULL indicates an invalid BAR index/number was specified. 764f11c7f63SJim Harris * @retval All other values indicate a valid VIRTUAL address from the BAR. 765f11c7f63SJim Harris */ 766f11c7f63SJim Harris void * scic_cb_pci_get_bar( 767f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 768f11c7f63SJim Harris U16 bar_number 769f11c7f63SJim Harris ); 770f11c7f63SJim Harris 771f11c7f63SJim Harris /** 772f11c7f63SJim Harris * @brief In this method the user must read from PCI memory via access. 773f11c7f63SJim Harris * This method is used for access to memory space and IO space. 774f11c7f63SJim Harris * 775f11c7f63SJim Harris * @param[in] controller The controller for which to read a DWORD. 776f11c7f63SJim Harris * @param[in] address This parameter depicts the address from 777f11c7f63SJim Harris * which to read. 778f11c7f63SJim Harris * 779f11c7f63SJim Harris * @return The value being returned from the PCI memory location. 780f11c7f63SJim Harris * 781f11c7f63SJim Harris * @todo This PCI memory access calls likely need to be optimized into macro? 782f11c7f63SJim Harris */ 783f11c7f63SJim Harris U32 scic_cb_pci_read_dword( 784f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 785f11c7f63SJim Harris void * address 786f11c7f63SJim Harris ); 787f11c7f63SJim Harris 788f11c7f63SJim Harris /** 789f11c7f63SJim Harris * @brief In this method the user must write to PCI memory via access. 790f11c7f63SJim Harris * This method is used for access to memory space and IO space. 791f11c7f63SJim Harris * 792f11c7f63SJim Harris * @param[in] controller The controller for which to read a DWORD. 793f11c7f63SJim Harris * @param[in] address This parameter depicts the address into 794f11c7f63SJim Harris * which to write. 795f11c7f63SJim Harris * @param[out] write_value This parameter depicts the value being written 796f11c7f63SJim Harris * into the PCI memory location. 797f11c7f63SJim Harris * 798f11c7f63SJim Harris * @todo This PCI memory access calls likely need to be optimized into macro? 799f11c7f63SJim Harris */ 800f11c7f63SJim Harris void scic_cb_pci_write_dword( 801f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 802f11c7f63SJim Harris void * address, 803f11c7f63SJim Harris U32 write_value 804f11c7f63SJim Harris ); 805f11c7f63SJim Harris 806f11c7f63SJim Harris /** 807f11c7f63SJim Harris * @brief This method informs the user when a stop operation on the port 808f11c7f63SJim Harris * has completed. 809f11c7f63SJim Harris * 810f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 811f11c7f63SJim Harris * contains the port. 812f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 813f11c7f63SJim Harris * the callback is being invoked. 814f11c7f63SJim Harris * @param[in] completion_status This parameter specifies the status for 815f11c7f63SJim Harris * the operation being completed. 816f11c7f63SJim Harris * 817f11c7f63SJim Harris * @return none 818f11c7f63SJim Harris */ 819f11c7f63SJim Harris void scic_cb_port_stop_complete( 820f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 821f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 822f11c7f63SJim Harris SCI_STATUS completion_status 823f11c7f63SJim Harris ); 824f11c7f63SJim Harris 825f11c7f63SJim Harris /** 826f11c7f63SJim Harris * @brief This method informs the user when a hard reset on the port 827f11c7f63SJim Harris * has completed. This hard reset could have been initiated by the 828f11c7f63SJim Harris * user or by the remote port. 829f11c7f63SJim Harris * 830f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 831f11c7f63SJim Harris * contains the port. 832f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 833f11c7f63SJim Harris * the callback is being invoked. 834f11c7f63SJim Harris * @param[in] completion_status This parameter specifies the status for 835f11c7f63SJim Harris * the operation being completed. 836f11c7f63SJim Harris * 837f11c7f63SJim Harris * @return none 838f11c7f63SJim Harris */ 839f11c7f63SJim Harris void scic_cb_port_hard_reset_complete( 840f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 841f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 842f11c7f63SJim Harris SCI_STATUS completion_status 843f11c7f63SJim Harris ); 844f11c7f63SJim Harris 845f11c7f63SJim Harris /** 846f11c7f63SJim Harris * @brief This method informs the user that the port is now in a ready 847f11c7f63SJim Harris * state and can be utilized to issue IOs. 848f11c7f63SJim Harris * 849f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 850f11c7f63SJim Harris * contains the port. 851f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 852f11c7f63SJim Harris * the callback is being invoked. 853f11c7f63SJim Harris * 854f11c7f63SJim Harris * @return none 855f11c7f63SJim Harris */ 856f11c7f63SJim Harris void scic_cb_port_ready( 857f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 858f11c7f63SJim Harris SCI_PORT_HANDLE_T port 859f11c7f63SJim Harris ); 860f11c7f63SJim Harris 861f11c7f63SJim Harris /** 862f11c7f63SJim Harris * @brief This method informs the user that the port is now not in a ready 863f11c7f63SJim Harris * (i.e. busy) state and can't be utilized to issue IOs. 864f11c7f63SJim Harris * 865f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 866f11c7f63SJim Harris * contains the port. 867f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 868f11c7f63SJim Harris * the callback is being invoked. 869f11c7f63SJim Harris * @param[in] reason_code This parameter specifies the reason for the port 870f11c7f63SJim Harris * not ready callback. 871f11c7f63SJim Harris * 872f11c7f63SJim Harris * @return none 873f11c7f63SJim Harris */ 874f11c7f63SJim Harris void scic_cb_port_not_ready( 875f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 876f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 877f11c7f63SJim Harris U32 reason_code 878f11c7f63SJim Harris ); 879f11c7f63SJim Harris 880f11c7f63SJim Harris /** 881f11c7f63SJim Harris * @brief This method informs the SCI Core user that a phy/link became 882f11c7f63SJim Harris * ready, but the phy is not allowed in the port. In some 883f11c7f63SJim Harris * situations the underlying hardware only allows for certain phy 884f11c7f63SJim Harris * to port mappings. If these mappings are violated, then this 885f11c7f63SJim Harris * API is invoked. 886f11c7f63SJim Harris * 887f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 888f11c7f63SJim Harris * contains the port. 889f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 890f11c7f63SJim Harris * the callback is being invoked. 891f11c7f63SJim Harris * @param[in] phy This parameter specifies the phy that came ready, but the 892f11c7f63SJim Harris * phy can't be a valid member of the port. 893f11c7f63SJim Harris * 894f11c7f63SJim Harris * @return none 895f11c7f63SJim Harris */ 896f11c7f63SJim Harris void scic_cb_port_invalid_link_up( 897f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 898f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 899f11c7f63SJim Harris SCI_PHY_HANDLE_T phy 900f11c7f63SJim Harris ); 901f11c7f63SJim Harris 902f11c7f63SJim Harris /** 903f11c7f63SJim Harris * @brief This callback method informs the user that a broadcast change 904f11c7f63SJim Harris * primitive was received. 905f11c7f63SJim Harris * 906f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 907f11c7f63SJim Harris * contains the port. 908f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 909f11c7f63SJim Harris * the callback is being invoked. For instances where the phy 910f11c7f63SJim Harris * on which the primitive was received is not part of a port, this 911f11c7f63SJim Harris * parameter will be SCI_INVALID_HANDLE_T. 912f11c7f63SJim Harris * @param[in] phy This parameter specifies the phy on which the primitive 913f11c7f63SJim Harris * was received. 914f11c7f63SJim Harris * 915f11c7f63SJim Harris * @return none 916f11c7f63SJim Harris */ 917f11c7f63SJim Harris void scic_cb_port_bc_change_primitive_recieved( 918f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 919f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 920f11c7f63SJim Harris SCI_PHY_HANDLE_T phy 921f11c7f63SJim Harris ); 922f11c7f63SJim Harris 923f11c7f63SJim Harris /** 924f11c7f63SJim Harris * @brief This callback method informs the user that a broadcast SES 925f11c7f63SJim Harris * primitive was received. 926f11c7f63SJim Harris * 927f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 928f11c7f63SJim Harris * contains the port. 929f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 930f11c7f63SJim Harris * the callback is being invoked. For instances where the phy 931f11c7f63SJim Harris * on which the primitive was received is not part of a port, this 932f11c7f63SJim Harris * parameter will be SCI_INVALID_HANDLE_T. 933f11c7f63SJim Harris * @param[in] phy This parameter specifies the phy on which the primitive 934f11c7f63SJim Harris * was received. 935f11c7f63SJim Harris * 936f11c7f63SJim Harris * @return none 937f11c7f63SJim Harris */ 938f11c7f63SJim Harris void scic_cb_port_bc_ses_primitive_recieved( 939f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 940f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 941f11c7f63SJim Harris SCI_PHY_HANDLE_T phy 942f11c7f63SJim Harris ); 943f11c7f63SJim Harris 944f11c7f63SJim Harris /** 945f11c7f63SJim Harris * @brief This callback method informs the user that a broadcast EXPANDER 946f11c7f63SJim Harris * primitive was received. 947f11c7f63SJim Harris * 948f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 949f11c7f63SJim Harris * contains the port. 950f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 951f11c7f63SJim Harris * the callback is being invoked. For instances where the phy 952f11c7f63SJim Harris * on which the primitive was received is not part of a port, this 953f11c7f63SJim Harris * parameter will be SCI_INVALID_HANDLE_T. 954f11c7f63SJim Harris * @param[in] phy This parameter specifies the phy on which the primitive 955f11c7f63SJim Harris * was received. 956f11c7f63SJim Harris * 957f11c7f63SJim Harris * @return none 958f11c7f63SJim Harris */ 959f11c7f63SJim Harris void scic_cb_port_bc_expander_primitive_recieved( 960f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 961f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 962f11c7f63SJim Harris SCI_PHY_HANDLE_T phy 963f11c7f63SJim Harris ); 964f11c7f63SJim Harris 965f11c7f63SJim Harris /** 966f11c7f63SJim Harris * @brief This callback method informs the user that a broadcast ASYNCHRONOUS 967f11c7f63SJim Harris * EVENT (AEN) primitive was received. 968f11c7f63SJim Harris * 969f11c7f63SJim Harris * @param[in] controller This parameter represents the controller which 970f11c7f63SJim Harris * contains the port. 971f11c7f63SJim Harris * @param[in] port This parameter specifies the SCI port object for which 972f11c7f63SJim Harris * the callback is being invoked. For instances where the phy 973f11c7f63SJim Harris * on which the primitive was received is not part of a port, this 974f11c7f63SJim Harris * parameter will be SCI_INVALID_HANDLE_T. 975f11c7f63SJim Harris * @param[in] phy This parameter specifies the phy on which the primitive 976f11c7f63SJim Harris * was received. 977f11c7f63SJim Harris * 978f11c7f63SJim Harris * @return none 979f11c7f63SJim Harris */ 980f11c7f63SJim Harris void scic_cb_port_bc_aen_primitive_recieved( 981f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 982f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 983f11c7f63SJim Harris SCI_PHY_HANDLE_T phy 984f11c7f63SJim Harris ); 985f11c7f63SJim Harris 986f11c7f63SJim Harris /** 987f11c7f63SJim Harris * @brief This callback method informs the user that a phy has become 988f11c7f63SJim Harris * operational and is capable of communicating with the remote end 989f11c7f63SJim Harris * point. 990f11c7f63SJim Harris * 991f11c7f63SJim Harris * @param[in] controller This parameter represents the controller 992f11c7f63SJim Harris * associated with the phy. 993f11c7f63SJim Harris * @param[in] port This parameter specifies the port object for which the 994f11c7f63SJim Harris * user callback is being invoked. There may be conditions where 995f11c7f63SJim Harris * this parameter can be SCI_INVALID_HANDLE 996f11c7f63SJim Harris * @param[in] phy This parameter specifies the phy object for which the 997f11c7f63SJim Harris * user callback is being invoked. 998f11c7f63SJim Harris * 999f11c7f63SJim Harris * @return none 1000f11c7f63SJim Harris */ 1001f11c7f63SJim Harris void scic_cb_port_link_up( 1002f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 1003f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 1004f11c7f63SJim Harris SCI_PHY_HANDLE_T phy 1005f11c7f63SJim Harris ); 1006f11c7f63SJim Harris 1007f11c7f63SJim Harris /** 1008f11c7f63SJim Harris * @brief This callback method informs the user that a phy is no longer 1009f11c7f63SJim Harris * operational and is not capable of communicating with the remote end 1010f11c7f63SJim Harris * point. 1011f11c7f63SJim Harris * 1012f11c7f63SJim Harris * @param[in] controller This parameter represents the controller 1013f11c7f63SJim Harris * associated with the phy. 1014f11c7f63SJim Harris * @param[in] port This parameter specifies the port object for which the 1015f11c7f63SJim Harris * user callback is being invoked. There may be conditions where 1016f11c7f63SJim Harris * this parameter can be SCI_INVALID_HANDLE 1017f11c7f63SJim Harris * @param[in] phy This parameter specifies the phy object for which the 1018f11c7f63SJim Harris * user callback is being invoked. 1019f11c7f63SJim Harris * 1020f11c7f63SJim Harris * @return none 1021f11c7f63SJim Harris */ 1022f11c7f63SJim Harris void scic_cb_port_link_down( 1023f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 1024f11c7f63SJim Harris SCI_PORT_HANDLE_T port, 1025f11c7f63SJim Harris SCI_PHY_HANDLE_T phy 1026f11c7f63SJim Harris ); 1027f11c7f63SJim Harris 1028f11c7f63SJim Harris /** 1029f11c7f63SJim Harris * @brief This user callback method will inform the user that a start 1030f11c7f63SJim Harris * operation has completed. 1031f11c7f63SJim Harris * 1032f11c7f63SJim Harris * @param[in] controller This parameter specifies the core controller 1033f11c7f63SJim Harris * associated with the completion callback. 1034f11c7f63SJim Harris * @param[in] remote_device This parameter specifies the remote device 1035f11c7f63SJim Harris * associated with the completion callback. 1036f11c7f63SJim Harris * @param[in] completion_status This parameter specifies the completion 1037f11c7f63SJim Harris * status for the operation. 1038f11c7f63SJim Harris * 1039f11c7f63SJim Harris * @return none 1040f11c7f63SJim Harris */ 1041f11c7f63SJim Harris void scic_cb_remote_device_start_complete( 1042f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 1043f11c7f63SJim Harris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 1044f11c7f63SJim Harris SCI_STATUS completion_status 1045f11c7f63SJim Harris ); 1046f11c7f63SJim Harris 1047f11c7f63SJim Harris /** 1048f11c7f63SJim Harris * @brief This user callback method will inform the user that a stop 1049f11c7f63SJim Harris * operation has completed. 1050f11c7f63SJim Harris * 1051f11c7f63SJim Harris * @param[in] controller This parameter specifies the core controller 1052f11c7f63SJim Harris * associated with the completion callback. 1053f11c7f63SJim Harris * @param[in] remote_device This parameter specifies the remote device 1054f11c7f63SJim Harris * associated with the completion callback. 1055f11c7f63SJim Harris * @param[in] completion_status This parameter specifies the completion 1056f11c7f63SJim Harris * status for the operation. 1057f11c7f63SJim Harris * 1058f11c7f63SJim Harris * @return none 1059f11c7f63SJim Harris */ 1060f11c7f63SJim Harris void scic_cb_remote_device_stop_complete( 1061f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 1062f11c7f63SJim Harris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 1063f11c7f63SJim Harris SCI_STATUS completion_status 1064f11c7f63SJim Harris ); 1065f11c7f63SJim Harris 1066f11c7f63SJim Harris /** 1067f11c7f63SJim Harris * @brief This user callback method will inform the user that a remote 1068f11c7f63SJim Harris * device is now capable of handling IO requests. 1069f11c7f63SJim Harris * 1070f11c7f63SJim Harris * @param[in] controller This parameter specifies the core controller 1071f11c7f63SJim Harris * associated with the completion callback. 1072f11c7f63SJim Harris * @param[in] remote_device This parameter specifies the remote device 1073f11c7f63SJim Harris * associated with the callback. 1074f11c7f63SJim Harris * 1075f11c7f63SJim Harris * @return none 1076f11c7f63SJim Harris */ 1077f11c7f63SJim Harris void scic_cb_remote_device_ready( 1078f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 1079f11c7f63SJim Harris SCI_REMOTE_DEVICE_HANDLE_T remote_device 1080f11c7f63SJim Harris ); 1081f11c7f63SJim Harris 1082f11c7f63SJim Harris /** 1083f11c7f63SJim Harris * @brief This user callback method will inform the user that a remote 1084f11c7f63SJim Harris * device is no longer capable of handling IO requests (until a 1085f11c7f63SJim Harris * ready callback is invoked). 1086f11c7f63SJim Harris * 1087f11c7f63SJim Harris * @param[in] controller This parameter specifies the core controller 1088f11c7f63SJim Harris * associated with the completion callback. 1089f11c7f63SJim Harris * @param[in] remote_device This parameter specifies the remote device 1090f11c7f63SJim Harris * associated with the callback. 1091f11c7f63SJim Harris * @param[in] reason_code This paramete specifies the reason the remote 1092f11c7f63SJim Harris * device is not ready. 1093f11c7f63SJim Harris * 1094f11c7f63SJim Harris * @return none 1095f11c7f63SJim Harris */ 1096f11c7f63SJim Harris void scic_cb_remote_device_not_ready( 1097f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 1098f11c7f63SJim Harris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 1099f11c7f63SJim Harris U32 reason_code 1100f11c7f63SJim Harris ); 1101f11c7f63SJim Harris 1102f11c7f63SJim Harris 1103f11c7f63SJim Harris /** 1104f11c7f63SJim Harris * @brief This user callback method will inform the user that this controller 1105f11c7f63SJim Harris * is having unexpected error. The user can choose to reset the controller. 1106f11c7f63SJim Harris * @param[in] controller The controller that is failed at the moment. 1107f11c7f63SJim Harris * 1108f11c7f63SJim Harris * @return none 1109f11c7f63SJim Harris */ 1110f11c7f63SJim Harris void scic_cb_controller_error( 1111f11c7f63SJim Harris SCI_CONTROLLER_HANDLE_T controller, 1112f11c7f63SJim Harris SCI_CONTROLLER_ERROR error 1113f11c7f63SJim Harris ); 1114f11c7f63SJim Harris 1115f11c7f63SJim Harris 1116f11c7f63SJim Harris #if !defined(DISABLE_ATAPI) 1117f11c7f63SJim Harris /** 1118f11c7f63SJim Harris * @brief This user callback gets from stp packet io's user request 1119f11c7f63SJim Harris * the CDB address. 1120f11c7f63SJim Harris * @param[in] scic_user_io_request 1121f11c7f63SJim Harris * 1122453130d9SPedro F. Giffuni * @return The cdb address. 1123f11c7f63SJim Harris */ 1124f11c7f63SJim Harris void * scic_cb_stp_packet_io_request_get_cdb_address( 1125f11c7f63SJim Harris void * scic_user_io_request 1126f11c7f63SJim Harris ); 1127f11c7f63SJim Harris 1128f11c7f63SJim Harris /** 1129f11c7f63SJim Harris * @brief This user callback gets from stp packet io's user request 1130f11c7f63SJim Harris * the CDB length. 1131f11c7f63SJim Harris * @param[in] scic_user_io_request 1132f11c7f63SJim Harris * 1133f11c7f63SJim Harris * @return The cdb length. 1134f11c7f63SJim Harris */ 1135f11c7f63SJim Harris U32 scic_cb_stp_packet_io_request_get_cdb_length( 1136f11c7f63SJim Harris void * scic_user_io_request 1137f11c7f63SJim Harris ); 1138f11c7f63SJim Harris #else //!defined(DISABLE_ATAPI) 1139f11c7f63SJim Harris #define scic_cb_stp_packet_io_request_get_cdb_address(scic_user_io_request) NULL 1140f11c7f63SJim Harris #define scic_cb_stp_packet_io_request_get_cdb_length(scic_user_io_request) 0 1141f11c7f63SJim Harris #endif //!defined(DISABLE_ATAPI) 1142f11c7f63SJim Harris 1143f11c7f63SJim Harris #ifdef __cplusplus 1144f11c7f63SJim Harris } 1145f11c7f63SJim Harris #endif // __cplusplus 1146f11c7f63SJim Harris 1147f11c7f63SJim Harris #endif // _SCIC_USER_CALLBACK_H_ 1148f11c7f63SJim Harris 1149