1230557Sjimharris/*- 2230557Sjimharris * This file is provided under a dual BSD/GPLv2 license. When using or 3230557Sjimharris * redistributing this file, you may do so under either license. 4230557Sjimharris * 5230557Sjimharris * GPL LICENSE SUMMARY 6230557Sjimharris * 7230557Sjimharris * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 8230557Sjimharris * 9230557Sjimharris * This program is free software; you can redistribute it and/or modify 10230557Sjimharris * it under the terms of version 2 of the GNU General Public License as 11230557Sjimharris * published by the Free Software Foundation. 12230557Sjimharris * 13230557Sjimharris * This program is distributed in the hope that it will be useful, but 14230557Sjimharris * WITHOUT ANY WARRANTY; without even the implied warranty of 15230557Sjimharris * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16230557Sjimharris * General Public License for more details. 17230557Sjimharris * 18230557Sjimharris * You should have received a copy of the GNU General Public License 19230557Sjimharris * along with this program; if not, write to the Free Software 20230557Sjimharris * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 21230557Sjimharris * The full GNU General Public License is included in this distribution 22230557Sjimharris * in the file called LICENSE.GPL. 23230557Sjimharris * 24230557Sjimharris * BSD LICENSE 25230557Sjimharris * 26230557Sjimharris * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 27230557Sjimharris * All rights reserved. 28230557Sjimharris * 29230557Sjimharris * Redistribution and use in source and binary forms, with or without 30230557Sjimharris * modification, are permitted provided that the following conditions 31230557Sjimharris * are met: 32230557Sjimharris * 33230557Sjimharris * * Redistributions of source code must retain the above copyright 34230557Sjimharris * notice, this list of conditions and the following disclaimer. 35230557Sjimharris * * Redistributions in binary form must reproduce the above copyright 36230557Sjimharris * notice, this list of conditions and the following disclaimer in 37230557Sjimharris * the documentation and/or other materials provided with the 38230557Sjimharris * distribution. 39230557Sjimharris * 40230557Sjimharris * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 41230557Sjimharris * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 42230557Sjimharris * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 43230557Sjimharris * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 44230557Sjimharris * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45230557Sjimharris * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 46230557Sjimharris * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 47230557Sjimharris * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 48230557Sjimharris * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 49230557Sjimharris * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 50230557Sjimharris * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51230557Sjimharris * 52230557Sjimharris * $FreeBSD$ 53230557Sjimharris */ 54230557Sjimharris#ifndef _SCIC_USER_CALLBACK_H_ 55230557Sjimharris#define _SCIC_USER_CALLBACK_H_ 56230557Sjimharris 57230557Sjimharris/** 58230557Sjimharris * @file 59230557Sjimharris * 60230557Sjimharris * @brief This file contains all of the interface methods/macros that must 61230557Sjimharris * be implemented by an SCI Core user. 62230557Sjimharris */ 63230557Sjimharris 64230557Sjimharris#ifdef __cplusplus 65230557Sjimharrisextern "C" { 66230557Sjimharris#endif // __cplusplus 67230557Sjimharris 68230557Sjimharris#include <dev/isci/scil/sci_types.h> 69230557Sjimharris#include <dev/isci/scil/sci_status.h> 70230557Sjimharris#include <dev/isci/scil/sci_controller.h> 71230557Sjimharris 72230557Sjimharris/** 73230557Sjimharris * @brief This callback method asks the user to create a timer and provide 74230557Sjimharris * a handle for this timer for use in further timer interactions. 75230557Sjimharris * 76230557Sjimharris * @warning The "timer_callback" method should be executed in a mutually 77230557Sjimharris * exlusive manner from the controller completion handler 78230557Sjimharris * handler (refer to scic_controller_get_handler_methods()). 79230557Sjimharris * 80230557Sjimharris * @param[in] controller This parameter specifies the controller with 81230557Sjimharris * which this timer is to be associated. 82230557Sjimharris * @param[in] timer_callback This parameter specifies the callback method 83230557Sjimharris * to be invoked whenever the timer expires. 84230557Sjimharris * @param[in] cookie This parameter specifies a piece of information that 85230557Sjimharris * the user must retain. This cookie is to be supplied by the 86230557Sjimharris * user anytime a timeout occurs for the created timer. 87230557Sjimharris * 88230557Sjimharris * @return This method returns a handle to a timer object created by the 89230557Sjimharris * user. The handle will be utilized for all further interactions 90230557Sjimharris * relating to this timer. 91230557Sjimharris */ 92230557Sjimharrisvoid * scic_cb_timer_create( 93230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 94230557Sjimharris SCI_TIMER_CALLBACK_T timer_callback, 95230557Sjimharris void * cookie 96230557Sjimharris); 97230557Sjimharris 98230557Sjimharris/** 99230557Sjimharris * @brief This callback method asks the user to destory the supplied timer. 100230557Sjimharris * 101230557Sjimharris * @param[in] controller This parameter specifies the controller with 102230557Sjimharris * which this timer is to associated. 103230557Sjimharris * @param[in] timer This parameter specifies the timer to be destroyed. 104230557Sjimharris * 105230557Sjimharris * @return none 106230557Sjimharris */ 107230557Sjimharrisvoid scic_cb_timer_destroy( 108230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 109230557Sjimharris void * timer 110230557Sjimharris); 111230557Sjimharris 112230557Sjimharris/** 113230557Sjimharris * @brief This callback method asks the user to start the supplied timer. 114230557Sjimharris * 115230557Sjimharris * @warning All timers in the system started by the SCI Core are one shot 116230557Sjimharris * timers. Therefore, the SCI user should make sure that it 117230557Sjimharris * removes the timer from it's list when a timer actually fires. 118230557Sjimharris * Additionally, SCI Core user's should be able to handle 119230557Sjimharris * calls from the SCI Core to stop a timer that may already 120230557Sjimharris * be stopped. 121230557Sjimharris * 122230557Sjimharris * @param[in] controller This parameter specifies the controller with 123230557Sjimharris * which this timer is to associated. 124230557Sjimharris * @param[in] timer This parameter specifies the timer to be started. 125230557Sjimharris * @param[in] milliseconds This parameter specifies the number of 126230557Sjimharris * milliseconds for which to stall. The operating system driver 127230557Sjimharris * is allowed to round this value up where necessary. 128230557Sjimharris * 129230557Sjimharris * @return none 130230557Sjimharris */ 131230557Sjimharrisvoid scic_cb_timer_start( 132230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 133230557Sjimharris void * timer, 134230557Sjimharris U32 milliseconds 135230557Sjimharris); 136230557Sjimharris 137230557Sjimharris/** 138230557Sjimharris * @brief This callback method asks the user to stop the supplied timer. 139230557Sjimharris * 140230557Sjimharris * @param[in] controller This parameter specifies the controller with 141230557Sjimharris * which this timer is to associated. 142230557Sjimharris * @param[in] timer This parameter specifies the timer to be stopped. 143230557Sjimharris * 144230557Sjimharris * @return none 145230557Sjimharris */ 146230557Sjimharrisvoid scic_cb_timer_stop( 147230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 148230557Sjimharris void * timer 149230557Sjimharris); 150230557Sjimharris 151230557Sjimharris/** 152230557Sjimharris * @brief This method is called when the core requires the OS driver 153230557Sjimharris * to stall execution. This method is utilized during initialization 154230557Sjimharris * or non-performance paths only. 155230557Sjimharris * 156230557Sjimharris * @param[in] microseconds This parameter specifies the number of 157230557Sjimharris * microseconds for which to stall. The operating system driver 158230557Sjimharris * is allowed to round this value up where necessary. 159230557Sjimharris * 160230557Sjimharris * @return none. 161230557Sjimharris */ 162230557Sjimharrisvoid scic_cb_stall_execution( 163230557Sjimharris U32 microseconds 164230557Sjimharris); 165230557Sjimharris 166230557Sjimharris/** 167230557Sjimharris * @brief This user callback will inform the user that the controller has 168230557Sjimharris * finished the start process. 169230557Sjimharris * 170230557Sjimharris * @param[in] controller This parameter specifies the controller that was 171230557Sjimharris * started. 172230557Sjimharris * @param[in] completion_status This parameter specifies the results of 173230557Sjimharris * the start operation. SCI_SUCCESS indicates successful 174230557Sjimharris * completion. 175230557Sjimharris * 176230557Sjimharris * @return none 177230557Sjimharris */ 178230557Sjimharrisvoid scic_cb_controller_start_complete( 179230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 180230557Sjimharris SCI_STATUS completion_status 181230557Sjimharris); 182230557Sjimharris 183230557Sjimharris/** 184230557Sjimharris * @brief This user callback will inform the user that the controller has 185230557Sjimharris * finished the stop process. 186230557Sjimharris * 187230557Sjimharris * @param[in] controller This parameter specifies the controller that was 188230557Sjimharris * stopped. 189230557Sjimharris * @param[in] completion_status This parameter specifies the results of 190230557Sjimharris * the stop operation. SCI_SUCCESS indicates successful 191230557Sjimharris * completion. 192230557Sjimharris * 193230557Sjimharris * @return none 194230557Sjimharris */ 195230557Sjimharrisvoid scic_cb_controller_stop_complete( 196230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 197230557Sjimharris SCI_STATUS completion_status 198230557Sjimharris); 199230557Sjimharris 200230557Sjimharris/** 201230557Sjimharris * @brief This user callback will inform the user that an IO request has 202230557Sjimharris * completed. 203230557Sjimharris * 204230557Sjimharris * @param[in] controller This parameter specifies the controller on 205230557Sjimharris * which the IO is completing. 206230557Sjimharris * @param[in] remote_device This parameter specifies the remote device on 207230557Sjimharris * which this IO request is completing. 208230557Sjimharris * @param[in] io_request This parameter specifies the IO request that has 209230557Sjimharris * completed. 210230557Sjimharris * @param[in] completion_status This parameter specifies the results of 211230557Sjimharris * the IO request operation. SCI_SUCCESS indicates successful 212230557Sjimharris * completion. 213230557Sjimharris * 214230557Sjimharris * @return none 215230557Sjimharris */ 216230557Sjimharrisvoid scic_cb_io_request_complete( 217230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 218230557Sjimharris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 219230557Sjimharris SCI_IO_REQUEST_HANDLE_T io_request, 220230557Sjimharris SCI_IO_STATUS completion_status 221230557Sjimharris); 222230557Sjimharris 223230557Sjimharris/** 224230557Sjimharris * @brief This method simply returns the virtual address associated 225230557Sjimharris * with the scsi_io and byte_offset supplied parameters. 226230557Sjimharris * 227230557Sjimharris * @note This callback is not utilized in the fast path. The expectation 228230557Sjimharris * is that this method is utilized for items such as SCSI to ATA 229230557Sjimharris * translation for commands like INQUIRY, READ CAPACITY, etc. 230230557Sjimharris * 231230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 232230557Sjimharris * IO request object. It is a cookie that allows the user to 233230557Sjimharris * provide the necessary information for this callback. 234230557Sjimharris * @param[in] byte_offset This parameter specifies the offset into the data 235230557Sjimharris * buffers pointed to by the SGL. The byte offset starts at 0 236230557Sjimharris * and continues until the last byte pointed to be the last SGL 237230557Sjimharris * element. 238230557Sjimharris * 239230557Sjimharris * @return A virtual address pointer to the location specified by the 240230557Sjimharris * parameters. 241230557Sjimharris */ 242230557SjimharrisU8 *scic_cb_io_request_get_virtual_address_from_sgl( 243230557Sjimharris void * scic_user_io_request, 244230557Sjimharris U32 byte_offset 245230557Sjimharris); 246230557Sjimharris 247230557Sjimharris/** 248230557Sjimharris * @brief This user callback will inform the user that a task management 249230557Sjimharris * request completed. 250230557Sjimharris * 251230557Sjimharris * @param[in] controller This parameter specifies the controller on 252230557Sjimharris * which the task management request is completing. 253230557Sjimharris * @param[in] remote_device This parameter specifies the remote device on 254230557Sjimharris * which this task management request is completing. 255230557Sjimharris * @param[in] task_request This parameter specifies the task management 256230557Sjimharris * request that has completed. 257230557Sjimharris * @param[in] completion_status This parameter specifies the results of 258230557Sjimharris * the IO request operation. SCI_SUCCESS indicates successful 259230557Sjimharris * completion. 260230557Sjimharris * 261230557Sjimharris * @return none 262230557Sjimharris */ 263230557Sjimharrisvoid scic_cb_task_request_complete( 264230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 265230557Sjimharris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 266230557Sjimharris SCI_TASK_REQUEST_HANDLE_T task_request, 267230557Sjimharris SCI_TASK_STATUS completion_status 268230557Sjimharris); 269230557Sjimharris 270230557Sjimharris#ifndef SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED 271230557Sjimharris/** 272230557Sjimharris * @brief This callback method asks the user to provide the physical 273230557Sjimharris * address for the supplied virtual address when building an 274230557Sjimharris * io request object. 275230557Sjimharris * 276230557Sjimharris * @param[in] controller This parameter is the core controller object 277230557Sjimharris * handle. 278230557Sjimharris * @param[in] io_request This parameter is the io request object handle 279230557Sjimharris * for which the physical address is being requested. 280230557Sjimharris * @param[in] virtual_address This paramter is the virtual address which 281230557Sjimharris * is to be returned as a physical address. 282230557Sjimharris * @param[out] physical_address The physical address for the supplied virtual 283230557Sjimharris * address. 284230557Sjimharris * 285230557Sjimharris * @return None. 286230557Sjimharris */ 287230557Sjimharrisvoid scic_cb_io_request_get_physical_address( 288230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 289230557Sjimharris SCI_IO_REQUEST_HANDLE_T io_request, 290230557Sjimharris void * virtual_address, 291230557Sjimharris SCI_PHYSICAL_ADDRESS * physical_address 292230557Sjimharris); 293230557Sjimharris#endif // SCI_GET_PHYSICAL_ADDRESS_OPTIMIZATION_ENABLED 294230557Sjimharris 295230557Sjimharris/** 296230557Sjimharris * @brief This callback method asks the user to provide the number of 297230557Sjimharris * bytes to be transfered as part of this request. 298230557Sjimharris * 299230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 300230557Sjimharris * IO request object. It is a cookie that allows the user to 301230557Sjimharris * provide the necessary information for this callback. 302230557Sjimharris * 303230557Sjimharris * @return This method returns the number of payload data bytes to be 304230557Sjimharris * transfered for this IO request. 305230557Sjimharris */ 306230557SjimharrisU32 scic_cb_io_request_get_transfer_length( 307230557Sjimharris void * scic_user_io_request 308230557Sjimharris); 309230557Sjimharris 310230557Sjimharris/** 311230557Sjimharris * @brief This callback method asks the user to provide the data direction 312230557Sjimharris * for this request. 313230557Sjimharris * 314230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 315230557Sjimharris * IO request object. It is a cookie that allows the user to 316230557Sjimharris * provide the necessary information for this callback. 317230557Sjimharris * 318230557Sjimharris * @return This method returns the value of SCI_IO_REQUEST_DATA_OUT or 319230557Sjimharris * SCI_IO_REQUEST_DATA_IN, or SCI_IO_REQUEST_NO_DATA. 320230557Sjimharris */ 321230557SjimharrisSCI_IO_REQUEST_DATA_DIRECTION scic_cb_io_request_get_data_direction( 322230557Sjimharris void * scic_user_io_request 323230557Sjimharris); 324230557Sjimharris 325230557Sjimharris#ifdef ENABLE_OSSL_COPY_BUFFER 326230557Sjimharris/** 327230557Sjimharris * @brief This method is presently utilized in the PIO path, 328230557Sjimharris * copies from UF buffer to the SGL buffer. This method 329230557Sjimharris * can be served for other OS related copies. 330230557Sjimharris * 331230557Sjimharris * @param[in] scic_user_io_request. This parameter points to the user's 332230557Sjimharris * IO request object. It is a cookie that allows the user to 333230557Sjimharris * provide the necessary information for this callback. 334230557Sjimharris * @param[in] source addr. Address of UF buffer. 335230557Sjimharris * @param[in] offset. This parameter specifies the offset into the data 336230557Sjimharris * buffers pointed to by the SGL. The byte offset starts at 0 337230557Sjimharris * and continues until the last byte pointed to be the last SGL 338230557Sjimharris * element. 339230557Sjimharris * @param[in] length. data length 340230557Sjimharris * 341230557Sjimharris * @return None 342230557Sjimharris */ 343230557Sjimharrisvoid scic_cb_io_request_copy_buffer( 344230557Sjimharris void * scic_user_io_request, 345230557Sjimharris U8 *source_addr, 346230557Sjimharris U32 offset, 347230557Sjimharris U32 length 348230557Sjimharris); 349230557Sjimharris#endif 350230557Sjimharris 351230557Sjimharris#ifndef SCI_SGL_OPTIMIZATION_ENABLED 352230557Sjimharris/** 353230557Sjimharris * @brief This callback method asks the user to provide the address 354230557Sjimharris * to where the next Scatter-Gather Element is located. 355230557Sjimharris * 356230557Sjimharris * Details regarding usage: 357230557Sjimharris * - Regarding the first SGE: the user should initialize an index, 358230557Sjimharris * or a pointer, prior to construction of the request that will 359230557Sjimharris * reference the very first scatter-gather element. This is 360230557Sjimharris * important since this method is called for every scatter-gather 361230557Sjimharris * element, including the first element. 362230557Sjimharris * - Regarding the last SGE: the user should return NULL from this 363230557Sjimharris * method when this method is called and the SGL has exhausted 364230557Sjimharris * all elements. 365230557Sjimharris * 366230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 367230557Sjimharris * IO request object. It is a cookie that allows the user to 368230557Sjimharris * provide the necessary information for this callback. 369230557Sjimharris * @param[in] current_sge_address This parameter specifies the address for 370230557Sjimharris * the current SGE (i.e. the one that has just processed). 371230557Sjimharris * @param[out] next_sge An address specifying the location for the next 372230557Sjimharris * scatter gather element to be processed. 373230557Sjimharris * 374230557Sjimharris * @return None 375230557Sjimharris */ 376230557Sjimharrisvoid scic_cb_io_request_get_next_sge( 377230557Sjimharris void * scic_user_io_request, 378230557Sjimharris void * current_sge_address, 379230557Sjimharris void ** next_sge 380230557Sjimharris); 381230557Sjimharris#endif // SCI_SGL_OPTIMIZATION_ENABLED 382230557Sjimharris 383230557Sjimharris/** 384230557Sjimharris * @brief This callback method asks the user to provide the contents of the 385230557Sjimharris * "address" field in the Scatter-Gather Element. 386230557Sjimharris * 387230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 388230557Sjimharris * IO request object. It is a cookie that allows the user to 389230557Sjimharris * provide the necessary information for this callback. 390230557Sjimharris * @param[in] sge_address This parameter specifies the address for the 391230557Sjimharris * SGE from which to retrieve the address field. 392230557Sjimharris * 393230557Sjimharris * @return A physical address specifying the contents of the SGE's address 394230557Sjimharris * field. 395230557Sjimharris */ 396230557SjimharrisSCI_PHYSICAL_ADDRESS scic_cb_sge_get_address_field( 397230557Sjimharris void * scic_user_io_request, 398230557Sjimharris void * sge_address 399230557Sjimharris); 400230557Sjimharris 401230557Sjimharris/** 402230557Sjimharris * @brief This callback method asks the user to provide the contents of the 403230557Sjimharris * "length" field in the Scatter-Gather Element. 404230557Sjimharris * 405230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 406230557Sjimharris * IO request object. It is a cookie that allows the user to 407230557Sjimharris * provide the necessary information for this callback. 408230557Sjimharris * @param[in] sge_address This parameter specifies the address for the 409230557Sjimharris * SGE from which to retrieve the address field. 410230557Sjimharris * 411230557Sjimharris * @return This method returns the length field specified inside the SGE 412230557Sjimharris * referenced by the sge_address parameter. 413230557Sjimharris */ 414230557SjimharrisU32 scic_cb_sge_get_length_field( 415230557Sjimharris void * scic_user_io_request, 416230557Sjimharris void * sge_address 417230557Sjimharris); 418230557Sjimharris 419230557Sjimharris/** 420230557Sjimharris * @brief This callback method asks the user to provide the address for 421230557Sjimharris * the command descriptor block (CDB) associated with this IO request. 422230557Sjimharris * 423230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 424230557Sjimharris * IO request object. It is a cookie that allows the user to 425230557Sjimharris * provide the necessary information for this callback. 426230557Sjimharris * 427230557Sjimharris * @return This method returns the virtual address of the CDB. 428230557Sjimharris */ 429230557Sjimharrisvoid * scic_cb_ssp_io_request_get_cdb_address( 430230557Sjimharris void * scic_user_io_request 431230557Sjimharris); 432230557Sjimharris 433230557Sjimharris/** 434230557Sjimharris * @brief This callback method asks the user to provide the length of 435230557Sjimharris * the command descriptor block (CDB) associated with this IO request. 436230557Sjimharris * 437230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 438230557Sjimharris * IO request object. It is a cookie that allows the user to 439230557Sjimharris * provide the necessary information for this callback. 440230557Sjimharris * 441230557Sjimharris * @return This method returns the length of the CDB. 442230557Sjimharris */ 443230557SjimharrisU32 scic_cb_ssp_io_request_get_cdb_length( 444230557Sjimharris void * scic_user_io_request 445230557Sjimharris); 446230557Sjimharris 447230557Sjimharris/** 448230557Sjimharris * @brief This callback method asks the user to provide the Logical Unit (LUN) 449230557Sjimharris * associated with this IO request. 450230557Sjimharris * 451230557Sjimharris * @note The contents of the value returned from this callback are defined 452230557Sjimharris * by the protocol standard (e.g. T10 SAS specification). Please 453230557Sjimharris * refer to the transport command information unit description 454230557Sjimharris * in the associated standard. 455230557Sjimharris * 456230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 457230557Sjimharris * IO request object. It is a cookie that allows the user to 458230557Sjimharris * provide the necessary information for this callback. 459230557Sjimharris * 460230557Sjimharris * @return This method returns the LUN associated with this request. 461230557Sjimharris * @todo This should be U64? 462230557Sjimharris */ 463230557SjimharrisU32 scic_cb_ssp_io_request_get_lun( 464230557Sjimharris void * scic_user_io_request 465230557Sjimharris); 466230557Sjimharris 467230557Sjimharris/** 468230557Sjimharris * @brief This callback method asks the user to provide the task attribute 469230557Sjimharris * associated with this IO request. 470230557Sjimharris * 471230557Sjimharris * @note The contents of the value returned from this callback are defined 472230557Sjimharris * by the protocol standard (e.g. T10 SAS specification). Please 473230557Sjimharris * refer to the transport command information unit description 474230557Sjimharris * in the associated standard. 475230557Sjimharris * 476230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 477230557Sjimharris * IO request object. It is a cookie that allows the user to 478230557Sjimharris * provide the necessary information for this callback. 479230557Sjimharris * 480230557Sjimharris * @return This method returns the task attribute associated with this 481230557Sjimharris * IO request. 482230557Sjimharris */ 483230557SjimharrisU32 scic_cb_ssp_io_request_get_task_attribute( 484230557Sjimharris void * scic_user_io_request 485230557Sjimharris); 486230557Sjimharris 487230557Sjimharris/** 488230557Sjimharris * @brief This callback method asks the user to provide the command priority 489230557Sjimharris * associated with this IO request. 490230557Sjimharris * 491230557Sjimharris * @note The contents of the value returned from this callback are defined 492230557Sjimharris * by the protocol standard (e.g. T10 SAS specification). Please 493230557Sjimharris * refer to the transport command information unit description 494230557Sjimharris * in the associated standard. 495230557Sjimharris * 496230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's 497230557Sjimharris * IO request object. It is a cookie that allows the user to 498230557Sjimharris * provide the necessary information for this callback. 499230557Sjimharris * 500230557Sjimharris * @return This method returns the command priority associated with this 501230557Sjimharris * IO request. 502230557Sjimharris */ 503230557SjimharrisU32 scic_cb_ssp_io_request_get_command_priority( 504230557Sjimharris void * scic_user_io_request 505230557Sjimharris); 506230557Sjimharris 507230557Sjimharris/** 508230557Sjimharris * @brief This callback method asks the user if the received RX frame data is 509230557Sjimharris * to be copied to the SGL or should be stored by the SCI core to be 510230557Sjimharris * retrieved later with the scic_io_request_get_rx_frame(). 511230557Sjimharris * 512230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's IO 513230557Sjimharris * request object. It is a cookie that allows the user to provide the 514230557Sjimharris * necessary information for this callback. 515230557Sjimharris * 516230557Sjimharris * @return This method returns TRUE if the SCI core should copy the received 517230557Sjimharris * frame data to the SGL location or FALSE if the SCI user wants to 518230557Sjimharris * retrieve the frame data at a later time. 519230557Sjimharris */ 520230557SjimharrisBOOL scic_cb_io_request_do_copy_rx_frames( 521230557Sjimharris void * scic_user_io_request 522230557Sjimharris); 523230557Sjimharris 524230557Sjimharris/** 525230557Sjimharris * @brief This callback method asks the user to return the SAT protocol 526230557Sjimharris * definition for this IO request. This method is only called by the 527230557Sjimharris * SCI core if the request type constructed is SATA. 528230557Sjimharris * 529230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's IO 530230557Sjimharris * request object. It is a cookie that allows the user to provide the 531230557Sjimharris * necessary information for this callback. 532230557Sjimharris * 533230557Sjimharris * @return This method returns one of the sat.h defined protocols for the 534230557Sjimharris * given io request. 535230557Sjimharris */ 536230557SjimharrisU8 scic_cb_request_get_sat_protocol( 537230557Sjimharris void * scic_user_io_request 538230557Sjimharris); 539230557Sjimharris 540230557Sjimharris/** 541230557Sjimharris * @brief This callback method asks the user to indicate if the IO is initially 542230557Sjimharris * constructed or is reconstructed using the recycled memory. 543230557Sjimharris * 544230557Sjimharris * @param[in] scic_user_io_request This parameter points to the user's IO 545230557Sjimharris * request object. It is a cookie that allows the user to provide the 546230557Sjimharris * necessary information for this callback. 547230557Sjimharris * 548230557Sjimharris * @return This method returns TRUE if the request is initial constructed. 549230557Sjimharris * This method returns FALSE if the request is constructed using recycled 550230557Sjimharris * memory. For many scic user, this method mostly always returns TRUE. 551230557Sjimharris */ 552230557SjimharrisBOOL scic_cb_request_is_initial_construction( 553230557Sjimharris void * scic_user_io_request 554230557Sjimharris); 555230557Sjimharris 556230557Sjimharris/** 557230557Sjimharris * @brief This method returns the Logical Unit to be utilized for this 558230557Sjimharris * task management request. 559230557Sjimharris * 560230557Sjimharris * @note The contents of the value returned from this callback are defined 561230557Sjimharris * by the protocol standard (e.g. T10 SAS specification). Please 562230557Sjimharris * refer to the transport task information unit description 563230557Sjimharris * in the associated standard. 564230557Sjimharris * 565230557Sjimharris * @param[in] scic_user_task_request This parameter points to the user's 566230557Sjimharris * task request object. It is a cookie that allows the user to 567230557Sjimharris * provide the necessary information for this callback. 568230557Sjimharris * 569230557Sjimharris * @return This method returns the LUN associated with this request. 570230557Sjimharris * @todo This should be U64? 571230557Sjimharris */ 572230557SjimharrisU32 scic_cb_ssp_task_request_get_lun( 573230557Sjimharris void * scic_user_task_request 574230557Sjimharris); 575230557Sjimharris 576230557Sjimharris/** 577230557Sjimharris * @brief This method returns the task management function to be utilized 578230557Sjimharris * for this task request. 579230557Sjimharris * 580230557Sjimharris * @note The contents of the value returned from this callback are defined 581230557Sjimharris * by the protocol standard (e.g. T10 SAS specification). Please 582230557Sjimharris * refer to the transport task information unit description 583230557Sjimharris * in the associated standard. 584230557Sjimharris * 585230557Sjimharris * @param[in] scic_user_task_request This parameter points to the user's 586230557Sjimharris * task request object. It is a cookie that allows the user to 587230557Sjimharris * provide the necessary information for this callback. 588230557Sjimharris * 589230557Sjimharris * @return This method returns an unsigned byte representing the task 590230557Sjimharris * management function to be performed. 591230557Sjimharris */ 592230557SjimharrisU8 scic_cb_ssp_task_request_get_function( 593230557Sjimharris void * scic_user_task_request 594230557Sjimharris); 595230557Sjimharris 596230557Sjimharris/** 597230557Sjimharris * @brief This method returns the task management IO tag to be managed. 598230557Sjimharris * Depending upon the task management function the value returned 599230557Sjimharris * from this method may be ignored. 600230557Sjimharris * 601230557Sjimharris * @param[in] scic_user_task_request This parameter points to the user's 602230557Sjimharris * task request object. It is a cookie that allows the user to 603230557Sjimharris * provide the necessary information for this callback. 604230557Sjimharris * 605230557Sjimharris * @return This method returns an unsigned 16-bit word depicting the IO 606230557Sjimharris * tag to be managed. 607230557Sjimharris */ 608230557SjimharrisU16 scic_cb_ssp_task_request_get_io_tag_to_manage( 609230557Sjimharris void * scic_user_task_request 610230557Sjimharris); 611230557Sjimharris 612230557Sjimharris/** 613230557Sjimharris * @brief This callback method asks the user to provide the virtual 614230557Sjimharris * address of the response data buffer for the supplied IO request. 615230557Sjimharris * 616230557Sjimharris * @param[in] scic_user_task_request This parameter points to the user's 617230557Sjimharris * task request object. It is a cookie that allows the user to 618230557Sjimharris * provide the necessary information for this callback. 619230557Sjimharris * 620230557Sjimharris * @return This method returns the virtual address for the response data buffer 621230557Sjimharris * associated with this IO request. 622230557Sjimharris */ 623230557Sjimharrisvoid * scic_cb_ssp_task_request_get_response_data_address( 624230557Sjimharris void * scic_user_task_request 625230557Sjimharris); 626230557Sjimharris 627230557Sjimharris/** 628230557Sjimharris * @brief This callback method asks the user to provide the length of the 629230557Sjimharris * response data buffer for the supplied IO request. 630230557Sjimharris * 631230557Sjimharris * @param[in] scic_user_task_request This parameter points to the user's 632230557Sjimharris * task request object. It is a cookie that allows the user to 633230557Sjimharris * provide the necessary information for this callback. 634230557Sjimharris * 635230557Sjimharris * @return This method returns the length of the response buffer data 636230557Sjimharris * associated with this IO request. 637230557Sjimharris */ 638230557SjimharrisU32 scic_cb_ssp_task_request_get_response_data_length( 639230557Sjimharris void * scic_user_task_request 640230557Sjimharris); 641230557Sjimharris 642230557Sjimharris/** 643230557Sjimharris * @brief In this method the user is expected to log the supplied 644230557Sjimharris * error information. The user must be capable of handling variable 645230557Sjimharris * length argument lists and should consider prepending the fact 646230557Sjimharris * that this is an error from the core. 647230557Sjimharris * 648230557Sjimharris * @param[in] logger_object This parameter specifies the logger object 649230557Sjimharris * associated with this message. 650230557Sjimharris * @param[in] log_object_mask This parameter specifies the log objects 651230557Sjimharris * for which this message is being generated. 652230557Sjimharris * @param[in] log_message This parameter specifies the message to be logged. 653230557Sjimharris * 654230557Sjimharris * @return none 655230557Sjimharris */ 656230557Sjimharrisvoid scic_cb_logger_log_error( 657230557Sjimharris SCI_LOGGER_HANDLE_T logger_object, 658230557Sjimharris U32 log_object_mask, 659230557Sjimharris char * log_message, 660230557Sjimharris ... 661230557Sjimharris); 662230557Sjimharris 663230557Sjimharris 664230557Sjimharris/** 665230557Sjimharris * @brief In this method the user is expected to log the supplied warning 666230557Sjimharris * information. The user must be capable of handling variable 667230557Sjimharris * length argument lists and should consider prepending the fact 668230557Sjimharris * that this is a warning from the core. 669230557Sjimharris * 670230557Sjimharris * @param[in] logger_object This parameter specifies the logger object 671230557Sjimharris * associated with this message. 672230557Sjimharris * @param[in] log_object_mask This parameter specifies the log objects 673230557Sjimharris * for which this message is being generated. 674230557Sjimharris * @param[in] log_message This parameter specifies the message to be logged. 675230557Sjimharris * 676230557Sjimharris * @return none 677230557Sjimharris */ 678230557Sjimharrisvoid scic_cb_logger_log_warning( 679230557Sjimharris SCI_LOGGER_HANDLE_T logger_object, 680230557Sjimharris U32 log_object_mask, 681230557Sjimharris char * log_message, 682230557Sjimharris ... 683230557Sjimharris); 684230557Sjimharris 685230557Sjimharris 686230557Sjimharris/** 687230557Sjimharris * @brief In this method the user is expected to log the supplied debug 688230557Sjimharris * information. The user must be capable of handling variable 689230557Sjimharris * length argument lists and should consider prepending the fact 690230557Sjimharris * that this is a debug message from the core. 691230557Sjimharris * 692230557Sjimharris * @param[in] logger_object This parameter specifies the logger object 693230557Sjimharris * associated with this message. 694230557Sjimharris * @param[in] log_object_mask This parameter specifies the log objects 695230557Sjimharris * for which this message is being generated. 696230557Sjimharris * @param[in] log_message This parameter specifies the message to be logged. 697230557Sjimharris * 698230557Sjimharris * @return none 699230557Sjimharris */ 700230557Sjimharrisvoid scic_cb_logger_log_info( 701230557Sjimharris SCI_LOGGER_HANDLE_T logger_object, 702230557Sjimharris U32 log_object_mask, 703230557Sjimharris char * log_message, 704230557Sjimharris ... 705230557Sjimharris); 706230557Sjimharris 707230557Sjimharris 708230557Sjimharris/** 709230557Sjimharris * @brief In this method the user is expected to log the supplied function 710230557Sjimharris * trace information. The user must be capable of handling variable 711230557Sjimharris * length argument lists and should consider prepending the fact 712230557Sjimharris * that this is a function trace (i.e. entry/exit) message from the 713230557Sjimharris * core. 714230557Sjimharris * 715230557Sjimharris * @param[in] logger_object This parameter specifies the logger object 716230557Sjimharris * associated with this message. 717230557Sjimharris * @param[in] log_object_mask This parameter specifies the log objects 718230557Sjimharris * for which this message is being generated. 719230557Sjimharris * @param[in] log_message This parameter specifies the message to be logged. 720230557Sjimharris * 721230557Sjimharris * @return none 722230557Sjimharris */ 723230557Sjimharrisvoid scic_cb_logger_log_trace( 724230557Sjimharris SCI_LOGGER_HANDLE_T logger_object, 725230557Sjimharris U32 log_object_mask, 726230557Sjimharris char * log_message, 727230557Sjimharris ... 728230557Sjimharris); 729230557Sjimharris 730230557Sjimharris 731230557Sjimharris/** 732230557Sjimharris * @brief In this method the user is expected to log the supplied state 733230557Sjimharris * transition information. The user must be capable of handling 734230557Sjimharris * variable length argument lists and should consider prepending the 735230557Sjimharris * fact that this is a warning from the core. 736230557Sjimharris * 737230557Sjimharris * @param[in] logger_object This parameter specifies the logger object 738230557Sjimharris * associated with this message. 739230557Sjimharris * @param[in] log_object_mask This parameter specifies the log objects 740230557Sjimharris * for which this message is being generated. 741230557Sjimharris * @param[in] log_message This parameter specifies the message to be logged. 742230557Sjimharris * 743230557Sjimharris * @return none 744230557Sjimharris */ 745230557Sjimharrisvoid scic_cb_logger_log_states( 746230557Sjimharris SCI_LOGGER_HANDLE_T logger_object, 747230557Sjimharris U32 log_object_mask, 748230557Sjimharris char * log_message, 749230557Sjimharris ... 750230557Sjimharris); 751230557Sjimharris 752230557Sjimharris 753230557Sjimharris/** 754230557Sjimharris * @brief In this method the user must return the base address register (BAR) 755230557Sjimharris * value for the supplied base address register number. 756230557Sjimharris * 757230557Sjimharris * @param[in] controller The controller for which to retrieve the bar number. 758230557Sjimharris * @param[in] bar_number This parameter depicts the BAR index/number to be read. 759230557Sjimharris * 760230557Sjimharris * @return Return a pointer value indicating the contents of the BAR. 761230557Sjimharris * @retval NULL indicates an invalid BAR index/number was specified. 762230557Sjimharris * @retval All other values indicate a valid VIRTUAL address from the BAR. 763230557Sjimharris */ 764230557Sjimharrisvoid * scic_cb_pci_get_bar( 765230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 766230557Sjimharris U16 bar_number 767230557Sjimharris); 768230557Sjimharris 769230557Sjimharris/** 770230557Sjimharris * @brief In this method the user must read from PCI memory via access. 771230557Sjimharris * This method is used for access to memory space and IO space. 772230557Sjimharris * 773230557Sjimharris * @param[in] controller The controller for which to read a DWORD. 774230557Sjimharris * @param[in] address This parameter depicts the address from 775230557Sjimharris * which to read. 776230557Sjimharris * 777230557Sjimharris * @return The value being returned from the PCI memory location. 778230557Sjimharris * 779230557Sjimharris * @todo This PCI memory access calls likely need to be optimized into macro? 780230557Sjimharris */ 781230557SjimharrisU32 scic_cb_pci_read_dword( 782230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 783230557Sjimharris void * address 784230557Sjimharris); 785230557Sjimharris 786230557Sjimharris/** 787230557Sjimharris * @brief In this method the user must write to PCI memory via access. 788230557Sjimharris * This method is used for access to memory space and IO space. 789230557Sjimharris * 790230557Sjimharris * @param[in] controller The controller for which to read a DWORD. 791230557Sjimharris * @param[in] address This parameter depicts the address into 792230557Sjimharris * which to write. 793230557Sjimharris * @param[out] write_value This parameter depicts the value being written 794230557Sjimharris * into the PCI memory location. 795230557Sjimharris * 796230557Sjimharris * @todo This PCI memory access calls likely need to be optimized into macro? 797230557Sjimharris */ 798230557Sjimharrisvoid scic_cb_pci_write_dword( 799230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 800230557Sjimharris void * address, 801230557Sjimharris U32 write_value 802230557Sjimharris); 803230557Sjimharris 804230557Sjimharris/** 805230557Sjimharris * @brief This method informs the user when a stop operation on the port 806230557Sjimharris * has completed. 807230557Sjimharris * 808230557Sjimharris * @param[in] controller This parameter represents the controller which 809230557Sjimharris * contains the port. 810230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 811230557Sjimharris * the callback is being invoked. 812230557Sjimharris * @param[in] completion_status This parameter specifies the status for 813230557Sjimharris * the operation being completed. 814230557Sjimharris * 815230557Sjimharris * @return none 816230557Sjimharris */ 817230557Sjimharrisvoid scic_cb_port_stop_complete( 818230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 819230557Sjimharris SCI_PORT_HANDLE_T port, 820230557Sjimharris SCI_STATUS completion_status 821230557Sjimharris); 822230557Sjimharris 823230557Sjimharris/** 824230557Sjimharris * @brief This method informs the user when a hard reset on the port 825230557Sjimharris * has completed. This hard reset could have been initiated by the 826230557Sjimharris * user or by the remote port. 827230557Sjimharris * 828230557Sjimharris * @param[in] controller This parameter represents the controller which 829230557Sjimharris * contains the port. 830230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 831230557Sjimharris * the callback is being invoked. 832230557Sjimharris * @param[in] completion_status This parameter specifies the status for 833230557Sjimharris * the operation being completed. 834230557Sjimharris * 835230557Sjimharris * @return none 836230557Sjimharris */ 837230557Sjimharrisvoid scic_cb_port_hard_reset_complete( 838230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 839230557Sjimharris SCI_PORT_HANDLE_T port, 840230557Sjimharris SCI_STATUS completion_status 841230557Sjimharris); 842230557Sjimharris 843230557Sjimharris/** 844230557Sjimharris * @brief This method informs the user that the port is now in a ready 845230557Sjimharris * state and can be utilized to issue IOs. 846230557Sjimharris * 847230557Sjimharris * @param[in] controller This parameter represents the controller which 848230557Sjimharris * contains the port. 849230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 850230557Sjimharris * the callback is being invoked. 851230557Sjimharris * 852230557Sjimharris * @return none 853230557Sjimharris */ 854230557Sjimharrisvoid scic_cb_port_ready( 855230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 856230557Sjimharris SCI_PORT_HANDLE_T port 857230557Sjimharris); 858230557Sjimharris 859230557Sjimharris/** 860230557Sjimharris * @brief This method informs the user that the port is now not in a ready 861230557Sjimharris * (i.e. busy) state and can't be utilized to issue IOs. 862230557Sjimharris * 863230557Sjimharris * @param[in] controller This parameter represents the controller which 864230557Sjimharris * contains the port. 865230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 866230557Sjimharris * the callback is being invoked. 867230557Sjimharris * @param[in] reason_code This parameter specifies the reason for the port 868230557Sjimharris * not ready callback. 869230557Sjimharris * 870230557Sjimharris * @return none 871230557Sjimharris */ 872230557Sjimharrisvoid scic_cb_port_not_ready( 873230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 874230557Sjimharris SCI_PORT_HANDLE_T port, 875230557Sjimharris U32 reason_code 876230557Sjimharris); 877230557Sjimharris 878230557Sjimharris/** 879230557Sjimharris * @brief This method informs the SCI Core user that a phy/link became 880230557Sjimharris * ready, but the phy is not allowed in the port. In some 881230557Sjimharris * situations the underlying hardware only allows for certain phy 882230557Sjimharris * to port mappings. If these mappings are violated, then this 883230557Sjimharris * API is invoked. 884230557Sjimharris * 885230557Sjimharris * @param[in] controller This parameter represents the controller which 886230557Sjimharris * contains the port. 887230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 888230557Sjimharris * the callback is being invoked. 889230557Sjimharris * @param[in] phy This parameter specifies the phy that came ready, but the 890230557Sjimharris * phy can't be a valid member of the port. 891230557Sjimharris * 892230557Sjimharris * @return none 893230557Sjimharris */ 894230557Sjimharrisvoid scic_cb_port_invalid_link_up( 895230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 896230557Sjimharris SCI_PORT_HANDLE_T port, 897230557Sjimharris SCI_PHY_HANDLE_T phy 898230557Sjimharris); 899230557Sjimharris 900230557Sjimharris/** 901230557Sjimharris * @brief This callback method informs the user that a broadcast change 902230557Sjimharris * primitive was received. 903230557Sjimharris * 904230557Sjimharris * @param[in] controller This parameter represents the controller which 905230557Sjimharris * contains the port. 906230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 907230557Sjimharris * the callback is being invoked. For instances where the phy 908230557Sjimharris * on which the primitive was received is not part of a port, this 909230557Sjimharris * parameter will be SCI_INVALID_HANDLE_T. 910230557Sjimharris * @param[in] phy This parameter specifies the phy on which the primitive 911230557Sjimharris * was received. 912230557Sjimharris * 913230557Sjimharris * @return none 914230557Sjimharris */ 915230557Sjimharrisvoid scic_cb_port_bc_change_primitive_recieved( 916230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 917230557Sjimharris SCI_PORT_HANDLE_T port, 918230557Sjimharris SCI_PHY_HANDLE_T phy 919230557Sjimharris); 920230557Sjimharris 921230557Sjimharris/** 922230557Sjimharris * @brief This callback method informs the user that a broadcast SES 923230557Sjimharris * primitive was received. 924230557Sjimharris * 925230557Sjimharris * @param[in] controller This parameter represents the controller which 926230557Sjimharris * contains the port. 927230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 928230557Sjimharris * the callback is being invoked. For instances where the phy 929230557Sjimharris * on which the primitive was received is not part of a port, this 930230557Sjimharris * parameter will be SCI_INVALID_HANDLE_T. 931230557Sjimharris * @param[in] phy This parameter specifies the phy on which the primitive 932230557Sjimharris * was received. 933230557Sjimharris * 934230557Sjimharris * @return none 935230557Sjimharris */ 936230557Sjimharrisvoid scic_cb_port_bc_ses_primitive_recieved( 937230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 938230557Sjimharris SCI_PORT_HANDLE_T port, 939230557Sjimharris SCI_PHY_HANDLE_T phy 940230557Sjimharris); 941230557Sjimharris 942230557Sjimharris/** 943230557Sjimharris * @brief This callback method informs the user that a broadcast EXPANDER 944230557Sjimharris * primitive was received. 945230557Sjimharris * 946230557Sjimharris * @param[in] controller This parameter represents the controller which 947230557Sjimharris * contains the port. 948230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 949230557Sjimharris * the callback is being invoked. For instances where the phy 950230557Sjimharris * on which the primitive was received is not part of a port, this 951230557Sjimharris * parameter will be SCI_INVALID_HANDLE_T. 952230557Sjimharris * @param[in] phy This parameter specifies the phy on which the primitive 953230557Sjimharris * was received. 954230557Sjimharris * 955230557Sjimharris * @return none 956230557Sjimharris */ 957230557Sjimharrisvoid scic_cb_port_bc_expander_primitive_recieved( 958230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 959230557Sjimharris SCI_PORT_HANDLE_T port, 960230557Sjimharris SCI_PHY_HANDLE_T phy 961230557Sjimharris); 962230557Sjimharris 963230557Sjimharris/** 964230557Sjimharris * @brief This callback method informs the user that a broadcast ASYNCHRONOUS 965230557Sjimharris * EVENT (AEN) primitive was received. 966230557Sjimharris * 967230557Sjimharris * @param[in] controller This parameter represents the controller which 968230557Sjimharris * contains the port. 969230557Sjimharris * @param[in] port This parameter specifies the SCI port object for which 970230557Sjimharris * the callback is being invoked. For instances where the phy 971230557Sjimharris * on which the primitive was received is not part of a port, this 972230557Sjimharris * parameter will be SCI_INVALID_HANDLE_T. 973230557Sjimharris * @param[in] phy This parameter specifies the phy on which the primitive 974230557Sjimharris * was received. 975230557Sjimharris * 976230557Sjimharris * @return none 977230557Sjimharris */ 978230557Sjimharrisvoid scic_cb_port_bc_aen_primitive_recieved( 979230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 980230557Sjimharris SCI_PORT_HANDLE_T port, 981230557Sjimharris SCI_PHY_HANDLE_T phy 982230557Sjimharris); 983230557Sjimharris 984230557Sjimharris/** 985230557Sjimharris * @brief This callback method informs the user that a phy has become 986230557Sjimharris * operational and is capable of communicating with the remote end 987230557Sjimharris * point. 988230557Sjimharris * 989230557Sjimharris * @param[in] controller This parameter represents the controller 990230557Sjimharris * associated with the phy. 991230557Sjimharris * @param[in] port This parameter specifies the port object for which the 992230557Sjimharris * user callback is being invoked. There may be conditions where 993230557Sjimharris * this parameter can be SCI_INVALID_HANDLE 994230557Sjimharris * @param[in] phy This parameter specifies the phy object for which the 995230557Sjimharris * user callback is being invoked. 996230557Sjimharris * 997230557Sjimharris * @return none 998230557Sjimharris */ 999230557Sjimharrisvoid scic_cb_port_link_up( 1000230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 1001230557Sjimharris SCI_PORT_HANDLE_T port, 1002230557Sjimharris SCI_PHY_HANDLE_T phy 1003230557Sjimharris); 1004230557Sjimharris 1005230557Sjimharris/** 1006230557Sjimharris * @brief This callback method informs the user that a phy is no longer 1007230557Sjimharris * operational and is not capable of communicating with the remote end 1008230557Sjimharris * point. 1009230557Sjimharris * 1010230557Sjimharris * @param[in] controller This parameter represents the controller 1011230557Sjimharris * associated with the phy. 1012230557Sjimharris * @param[in] port This parameter specifies the port object for which the 1013230557Sjimharris * user callback is being invoked. There may be conditions where 1014230557Sjimharris * this parameter can be SCI_INVALID_HANDLE 1015230557Sjimharris * @param[in] phy This parameter specifies the phy object for which the 1016230557Sjimharris * user callback is being invoked. 1017230557Sjimharris * 1018230557Sjimharris * @return none 1019230557Sjimharris */ 1020230557Sjimharrisvoid scic_cb_port_link_down( 1021230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 1022230557Sjimharris SCI_PORT_HANDLE_T port, 1023230557Sjimharris SCI_PHY_HANDLE_T phy 1024230557Sjimharris); 1025230557Sjimharris 1026230557Sjimharris/** 1027230557Sjimharris * @brief This user callback method will inform the user that a start 1028230557Sjimharris * operation has completed. 1029230557Sjimharris * 1030230557Sjimharris * @param[in] controller This parameter specifies the core controller 1031230557Sjimharris * associated with the completion callback. 1032230557Sjimharris * @param[in] remote_device This parameter specifies the remote device 1033230557Sjimharris * associated with the completion callback. 1034230557Sjimharris * @param[in] completion_status This parameter specifies the completion 1035230557Sjimharris * status for the operation. 1036230557Sjimharris * 1037230557Sjimharris * @return none 1038230557Sjimharris */ 1039230557Sjimharrisvoid scic_cb_remote_device_start_complete( 1040230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 1041230557Sjimharris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 1042230557Sjimharris SCI_STATUS completion_status 1043230557Sjimharris); 1044230557Sjimharris 1045230557Sjimharris/** 1046230557Sjimharris * @brief This user callback method will inform the user that a stop 1047230557Sjimharris * operation has completed. 1048230557Sjimharris * 1049230557Sjimharris * @param[in] controller This parameter specifies the core controller 1050230557Sjimharris * associated with the completion callback. 1051230557Sjimharris * @param[in] remote_device This parameter specifies the remote device 1052230557Sjimharris * associated with the completion callback. 1053230557Sjimharris * @param[in] completion_status This parameter specifies the completion 1054230557Sjimharris * status for the operation. 1055230557Sjimharris * 1056230557Sjimharris * @return none 1057230557Sjimharris */ 1058230557Sjimharrisvoid scic_cb_remote_device_stop_complete( 1059230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 1060230557Sjimharris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 1061230557Sjimharris SCI_STATUS completion_status 1062230557Sjimharris); 1063230557Sjimharris 1064230557Sjimharris/** 1065230557Sjimharris * @brief This user callback method will inform the user that a remote 1066230557Sjimharris * device is now capable of handling IO requests. 1067230557Sjimharris * 1068230557Sjimharris * @param[in] controller This parameter specifies the core controller 1069230557Sjimharris * associated with the completion callback. 1070230557Sjimharris * @param[in] remote_device This parameter specifies the remote device 1071230557Sjimharris * associated with the callback. 1072230557Sjimharris * 1073230557Sjimharris * @return none 1074230557Sjimharris */ 1075230557Sjimharrisvoid scic_cb_remote_device_ready( 1076230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 1077230557Sjimharris SCI_REMOTE_DEVICE_HANDLE_T remote_device 1078230557Sjimharris); 1079230557Sjimharris 1080230557Sjimharris/** 1081230557Sjimharris * @brief This user callback method will inform the user that a remote 1082230557Sjimharris * device is no longer capable of handling IO requests (until a 1083230557Sjimharris * ready callback is invoked). 1084230557Sjimharris * 1085230557Sjimharris * @param[in] controller This parameter specifies the core controller 1086230557Sjimharris * associated with the completion callback. 1087230557Sjimharris * @param[in] remote_device This parameter specifies the remote device 1088230557Sjimharris * associated with the callback. 1089230557Sjimharris * @param[in] reason_code This paramete specifies the reason the remote 1090230557Sjimharris * device is not ready. 1091230557Sjimharris * 1092230557Sjimharris * @return none 1093230557Sjimharris */ 1094230557Sjimharrisvoid scic_cb_remote_device_not_ready( 1095230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 1096230557Sjimharris SCI_REMOTE_DEVICE_HANDLE_T remote_device, 1097230557Sjimharris U32 reason_code 1098230557Sjimharris); 1099230557Sjimharris 1100230557Sjimharris 1101230557Sjimharris/** 1102230557Sjimharris * @brief This user callback method will inform the user that this controller 1103230557Sjimharris * is having unexpected error. The user can choose to reset the controller. 1104230557Sjimharris * @param[in] controller The controller that is failed at the moment. 1105230557Sjimharris * 1106230557Sjimharris * @return none 1107230557Sjimharris */ 1108230557Sjimharrisvoid scic_cb_controller_error( 1109230557Sjimharris SCI_CONTROLLER_HANDLE_T controller, 1110230557Sjimharris SCI_CONTROLLER_ERROR error 1111230557Sjimharris); 1112230557Sjimharris 1113230557Sjimharris 1114230557Sjimharris#if !defined(DISABLE_ATAPI) 1115230557Sjimharris/** 1116230557Sjimharris * @brief This user callback gets from stp packet io's user request 1117230557Sjimharris * the CDB address. 1118230557Sjimharris * @param[in] scic_user_io_request 1119230557Sjimharris * 1120230557Sjimharris * @return The cdb adress. 1121230557Sjimharris */ 1122230557Sjimharrisvoid * scic_cb_stp_packet_io_request_get_cdb_address( 1123230557Sjimharris void * scic_user_io_request 1124230557Sjimharris); 1125230557Sjimharris 1126230557Sjimharris/** 1127230557Sjimharris * @brief This user callback gets from stp packet io's user request 1128230557Sjimharris * the CDB length. 1129230557Sjimharris * @param[in] scic_user_io_request 1130230557Sjimharris * 1131230557Sjimharris * @return The cdb length. 1132230557Sjimharris */ 1133230557SjimharrisU32 scic_cb_stp_packet_io_request_get_cdb_length( 1134230557Sjimharris void * scic_user_io_request 1135230557Sjimharris); 1136230557Sjimharris#else //!defined(DISABLE_ATAPI) 1137230557Sjimharris#define scic_cb_stp_packet_io_request_get_cdb_address(scic_user_io_request) NULL 1138230557Sjimharris#define scic_cb_stp_packet_io_request_get_cdb_length(scic_user_io_request) 0 1139230557Sjimharris#endif //!defined(DISABLE_ATAPI) 1140230557Sjimharris 1141230557Sjimharris#ifdef __cplusplus 1142230557Sjimharris} 1143230557Sjimharris#endif // __cplusplus 1144230557Sjimharris 1145230557Sjimharris#endif // _SCIC_USER_CALLBACK_H_ 1146230557Sjimharris 1147