1 /*- 2 * This file is provided under a dual BSD/GPLv2 license. When using or 3 * redistributing this file, you may do so under either license. 4 * 5 * GPL LICENSE SUMMARY 6 * 7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 8 * 9 * This program is free software; you can redistribute it and/or modify 10 * it under the terms of version 2 of the GNU General Public License as 11 * published by the Free Software Foundation. 12 * 13 * This program is distributed in the hope that it will be useful, but 14 * WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 21 * The full GNU General Public License is included in this distribution 22 * in the file called LICENSE.GPL. 23 * 24 * BSD LICENSE 25 * 26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 27 * All rights reserved. 28 * 29 * Redistribution and use in source and binary forms, with or without 30 * modification, are permitted provided that the following conditions 31 * are met: 32 * 33 * * Redistributions of source code must retain the above copyright 34 * notice, this list of conditions and the following disclaimer. 35 * * Redistributions in binary form must reproduce the above copyright 36 * notice, this list of conditions and the following disclaimer in 37 * the documentation and/or other materials provided with the 38 * distribution. 39 * 40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 41 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 42 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 43 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 44 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 46 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 47 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 48 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 49 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 50 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 * 52 * $FreeBSD$ 53 */ 54 #ifndef _SCIC_IO_REQUEST_H_ 55 #define _SCIC_IO_REQUEST_H_ 56 57 /** 58 * @file 59 * 60 * @brief This file contains the structures and interface methods that 61 * can be referenced and used by the SCI user for the SCI IO request 62 * object. 63 * 64 * @todo Determine the failure situations and return values. 65 */ 66 67 #ifdef __cplusplus 68 extern "C" { 69 #endif // __cplusplus 70 71 #include <dev/isci/scil/sci_types.h> 72 #include <dev/isci/scil/sci_status.h> 73 #include <dev/isci/scil/intel_sas.h> 74 75 /** 76 * @struct SCIC_IO_SSP_PARAMETERS 77 * @brief This structure contains additional optional parameters for SSP 78 * IO requests. These parameters are utilized with the 79 * scic_io_request_construct_advanced_ssp() method. 80 * 81 * @todo Add Block-guard/DIF, TLR 82 */ 83 typedef struct SCIC_IO_SSP_PARAMETERS 84 { 85 /** 86 * Data Integrity Format (DIF) is also known as protection information 87 * or block-guard. This sub-structure contains DIF specific feature 88 * information for SSP IO requests. 89 */ 90 struct 91 { 92 void * placeholder; 93 } dif; 94 95 /** 96 * Transport Layer Retries (TLR) is an SSP protocol specific feature. 97 * This sub-structure contains Transport Layer Retries (TLR) specific 98 * feature information for SSP IO requests. 99 */ 100 struct 101 { 102 void * placeholder; 103 } tlr; 104 105 } SCIC_IO_SSP_PARAMETERS_T; 106 107 /** 108 * @struct SCIC_IO_PARAMETERS 109 * @brief This structure contains additional optional parameters for 110 * STP/SATA IO requests. These parameters are utilized with the 111 * scic_io_request_construct_advanced_sata() method. 112 */ 113 typedef struct SCIC_IO_SATA_PARAMETERS 114 { 115 /** 116 * This field indicates whether or not to construct the Scatter-Gather 117 * List elements for the SATA request. This is used in scenarios 118 * where Scatter-gather-list processing/translation is done by the 119 * user. 120 */ 121 BOOL do_translate_sgl; 122 123 } SCIC_IO_SATA_PARAMETERS_T; 124 125 /** 126 * @struct SCIC_PASSTHRU_REQUEST_CALLBACKS 127 * @brief This structure contains the pointer to the callback functions 128 * for constructing the passthrough request common to SSP, SMP and STP. 129 * This structure must be set by the win sci layer before the passthrough 130 * build is called 131 * 132 */ 133 typedef struct SCIC_PASSTHRU_REQUEST_CALLBACKS 134 { 135 /** 136 * Function pointer to get the phy identifier for passthrough request. 137 */ 138 U32 (*scic_cb_passthru_get_phy_identifier) ( void * , U8 *); 139 /** 140 * Function pointer to get the port identifier for passthrough request. 141 */ 142 U32 (*scic_cb_passthru_get_port_identifier) ( void * , U8 *); 143 /** 144 * Function pointer to get the connection rate for passthrough request. 145 */ 146 U32 (*scic_cb_passthru_get_connection_rate) ( void * , void *); 147 /** 148 * Function pointer to get the destination sas address for passthrough request. 149 */ 150 void (*scic_cb_passthru_get_destination_sas_address) (void *, U8 **); 151 /** 152 * Function pointer to get the transfer length for passthrough request. 153 */ 154 U32 (*scic_cb_passthru_get_transfer_length) (void *); 155 /** 156 * Function pointer to get the data direction for passthrough request. 157 */ 158 U32 (*scic_cb_passthru_get_data_direction) (void *); 159 160 } SCIC_PASSTHRU_REQUEST_CALLBACKS_T; 161 162 /** 163 * @struct SCIC_SSP_PASSTHRU_REQUEST_CALLBACKS 164 * @brief This structure contains the pointer to the callback functions 165 * for constructing the passthrough request specific to SSP. 166 * This structure must be set by the win sci layer before the passthrough 167 * build is called 168 * 169 */ 170 typedef struct SCIC_SSP_PASSTHRU_REQUEST_CALLBACKS 171 { 172 /** 173 * Common callbacks for all Passthru requests 174 */ 175 SCIC_PASSTHRU_REQUEST_CALLBACKS_T common_callbacks; 176 /** 177 * Function pointer to get the lun for passthrough request. 178 */ 179 void (* scic_cb_ssp_passthru_get_lun) (void *, U8 **); 180 /** 181 * Function pointer to get the cdb 182 */ 183 void (* scic_cb_ssp_passthru_get_cdb) ( void *, U32 *, U8 **, U32 *, U8 ** ); 184 /** 185 * Function pointer to get the task attribute for passthrough request. 186 */ 187 U32 (*scic_cb_ssp_passthru_get_task_attribute) (void *); 188 } SCIC_SSP_PASSTHRU_REQUEST_CALLBACKS_T; 189 190 /** 191 * @struct SCIC_STP_PASSTHRU_REQUEST_CALLBACKS 192 * @brief This structure contains the pointer to the callback functions 193 * for constructing the passthrough request specific to STP. 194 * This structure must be set by the win sci layer before the passthrough 195 * build is called 196 * 197 */ 198 typedef struct SCIC_STP_PASSTHRU_REQUEST_CALLBACKS 199 { 200 /** 201 * Common callbacks for all Passthru requests 202 */ 203 SCIC_PASSTHRU_REQUEST_CALLBACKS_T common_callbacks; 204 /** 205 * Function pointer to get the protocol for passthrough request. 206 */ 207 U8 (* scic_cb_stp_passthru_get_protocol) (void *); 208 /** 209 * Function pointer to get the resgister fis 210 */ 211 void (* scic_cb_stp_passthru_get_register_fis) ( void *, U8 ** ); 212 /** 213 * Function pointer to get the MULTIPLE_COUNT (bits 5,6,7 in Byte 1 in the SAT-specific SCSI extenstion in ATA Pass-through (0x85)) 214 */ 215 U8 (* scic_cb_stp_passthru_get_multiplecount) ( void *); 216 /** 217 * Function pointer to get the EXTEND (bit 0 in Byte 1 the SAT-specific SCSI extenstion in ATA Pass-through (0x85)) 218 */ 219 U8 (* scic_cb_stp_passthru_get_extend) ( void *); 220 /** 221 * Function pointer to get the CK_COND (bit 5 in Byte 2 the SAT-specific SCSI extenstion in ATA Pass-through (0x85)) 222 */ 223 U8 (* scic_cb_stp_passthru_get_ckcond) ( void *); 224 /** 225 * Function pointer to get the T_DIR (bit 3 in Byte 2 the SAT-specific SCSI extenstion in ATA Pass-through (0x85)) 226 */ 227 U8 (* scic_cb_stp_passthru_get_tdir) ( void *); 228 /** 229 * Function pointer to get the BYTE_BLOCK (bit 2 in Byte 2 the SAT-specific SCSI extenstion in ATA Pass-through (0x85)) 230 */ 231 U8 (* scic_cb_stp_passthru_get_byteblock) ( void *); 232 /** 233 * Function pointer to get the T_LENGTH (bits 0,1 in Byte 2 the SAT-specific SCSI extenstion in ATA Pass-through (0x85)) 234 */ 235 U8 (* scic_cb_stp_passthru_get_tlength) ( void *); 236 237 } SCIC_STP_PASSTHRU_REQUEST_CALLBACKS_T; 238 239 /** 240 * @struct SCIC_SMP_PASSTHRU_REQUEST_CALLBACKS 241 * @brief This structure contains the pointer to the callback functions 242 * for constructing the passthrough request specific to SMP. 243 * This structure must be set by the win sci layer before the passthrough 244 * build is called 245 * 246 */ 247 typedef struct SCIC_SMP_PASSTHRU_REQUEST_CALLBACKS 248 { 249 /** 250 * Common callbacks for all Passthru requests 251 */ 252 SCIC_PASSTHRU_REQUEST_CALLBACKS_T common_callbacks; 253 254 /** 255 * Function pointer to get the length of the smp request and its length 256 */ 257 U32 (* scic_cb_smp_passthru_get_request) ( void *, U8 ** ); 258 /** 259 * Function pointer to get the frame type of the smp request 260 */ 261 U8 (* scic_cb_smp_passthru_get_frame_type) ( void *); 262 /** 263 * Function pointer to get the function in the smp request 264 */ 265 U8 (* scic_cb_smp_passthru_get_function) ( void * ); 266 267 /** 268 * Function pointer to get the "allocated response length" in the smp request 269 */ 270 U8 (* scic_cb_smp_passthru_get_allocated_response_length) ( void * ); 271 272 } SCIC_SMP_PASSTHRU_REQUEST_CALLBACKS_T; 273 274 /** 275 * @brief This enumeration specifies the transport protocol utilized 276 * for the request. 277 */ 278 typedef enum 279 { 280 /** 281 * This enumeration constant indicates that no protocol has yet been 282 * set. 283 */ 284 SCIC_NO_PROTOCOL, 285 286 /** 287 * This enumeration constant indicates that the protocol utilized 288 * is the Serial Management Protocol. 289 */ 290 SCIC_SMP_PROTOCOL, 291 292 /** 293 * This enumeration constant indicates that the protocol utilized 294 * is the Serial SCSI Protocol. 295 */ 296 SCIC_SSP_PROTOCOL, 297 298 /** 299 * This enumeration constant indicates that the protocol utilized 300 * is the Serial-ATA Tunneling Protocol. 301 */ 302 SCIC_STP_PROTOCOL 303 304 } SCIC_TRANSPORT_PROTOCOL; 305 306 307 /** 308 * @brief This method simply returns the size required to build an SCI 309 * based IO request object. 310 * 311 * @return Return the size of the SCI IO request object. 312 */ 313 U32 scic_io_request_get_object_size( 314 void 315 ); 316 317 /** 318 * @brief This method is called by the SCI user to construct all SCI Core 319 * IO requests. Memory initialization and functionality common to 320 * all IO request types is performed in this method. 321 * 322 * @note The SCI core implementation will create an association between 323 * the user IO request object and the core IO request object. 324 * 325 * @param[in] scic_controller the handle to the core controller object 326 * for which to build an IO request. 327 * @param[in] scic_remote_device the handle to the core remote device 328 * object for which to build an IO request. 329 * @param[in] io_tag This parameter specifies the IO tag to be associated 330 * with this request. If SCI_CONTROLLER_INVALID_IO_TAG is 331 * passed, then a copy of the request is built internally. The 332 * request will be copied into the actual controller request 333 * memory when the IO tag is allocated internally during the 334 * scic_controller_start_io() method. 335 * @param[in] user_io_request_object This parameter specifies the user 336 * IO request to be utilized during IO construction. This IO 337 * pointer will become the associated object for the core 338 * IO request object. 339 * @param[in] scic_io_request_memory This parameter specifies the memory 340 * location to be utilized when building the core request. 341 * @param[out] new_scic_io_request_handle This parameter specifies a 342 * pointer to the handle the core will expect in further 343 * interactions with the core IO request object. 344 * 345 * @return Indicate if the controller successfully built the IO request. 346 * @retval SCI_SUCCESS This value is returned if the IO request was 347 * successfully built. 348 */ 349 SCI_STATUS scic_io_request_construct( 350 SCI_CONTROLLER_HANDLE_T scic_controller, 351 SCI_REMOTE_DEVICE_HANDLE_T scic_remote_device, 352 U16 io_tag, 353 void * user_io_request_object, 354 void * scic_io_request_memory, 355 SCI_IO_REQUEST_HANDLE_T * new_scic_io_request_handle 356 ); 357 358 /** 359 * @brief This method is called by the SCI user to build an SSP 360 * IO request. 361 * 362 * @pre 363 * - The user must have previously called scic_io_request_construct() 364 * on the supplied IO request. 365 * 366 * @param[in] scic_io_request This parameter specifies the handle to the 367 * io request object to be built. 368 * 369 * @return Indicate if the controller successfully built the IO request. 370 * @retval SCI_SUCCESS This value is returned if the IO request was 371 * successfully built. 372 * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the 373 * remote_device does not support the SSP protocol. 374 * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the 375 * user did not properly set the association between the SCIC IO 376 * request and the user's IO request. Please refer to the 377 * sci_object_set_association() routine for more 378 * information. 379 */ 380 SCI_STATUS scic_io_request_construct_basic_ssp( 381 SCI_IO_REQUEST_HANDLE_T scic_io_request 382 ); 383 384 /** 385 * @brief This method is called by the SCI user to build an SSP 386 * IO request with additional parameters that provide additional 387 * flexibility from the standard scic_io_request_construct_basic_ssp() 388 * method. 389 * 390 * @pre 391 * - The user must have previously called scic_io_request_construct() 392 * on the supplied IO request. 393 * 394 * @param[in] scic_io_request This parameter specifies the handle to the 395 * io request object to be built. 396 * @param[in] io_parameters the additional parameter information to 397 * be added to the outgoing IO request. 398 * 399 * @return Indicate if the controller successfully built the IO request. 400 * @retval SCI_SUCCESS This value is returned if the IO request was 401 * successfully built. 402 * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the 403 * remote_device does not support the SSP protocol. 404 * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the 405 * user did not properly set the association between the SCIC IO 406 * request and the user's IO request. Please refer to the 407 * sci_object_set_association() routine for more 408 * information. 409 * 410 * @todo Determine the failure situations and return values. 411 */ 412 SCI_STATUS scic_io_request_construct_advanced_ssp( 413 SCI_IO_REQUEST_HANDLE_T scic_io_request, 414 SCIC_IO_SSP_PARAMETERS_T * io_parameters 415 ); 416 417 #if !defined(DISABLE_PASS_THROUGH) 418 419 /** 420 * @brief This method will build an IO request based on the user information 421 * supplied in the pass-through IO request object. 422 * 423 * @param[in] scic_io_request This parameter specifies the handle to the 424 * io request object to be built. 425 * 426 * @param[in] ssp_passthru_cb This parameter specifies the pointer to 427 * the structure containing the callback to the function 428 * pointers to get the needed fields from the pass-through 429 * reqiest instead of SRB 430 * 431 * @return Indicate if the controller successfully built the IO request. 432 * @retval SCI_SUCCESS This value is returned if the IO request was 433 * successfully built. 434 * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the 435 * user did not properly set the association between the SCIC IO 436 * request and the user's IO request. Please refer to the 437 * sci_object_set_association() routine for more 438 * information. 439 */ 440 SCI_STATUS scic_io_request_construct_ssp_pass_through( 441 void * scic_io_request_memory, 442 SCIC_SSP_PASSTHRU_REQUEST_CALLBACKS_T *ssp_passthru_cb 443 ); 444 445 #else // !defined(DISABLE_PASS_THROUGH) 446 447 #define scic_io_request_construct_ssp_pass_through(memory, cb) SCI_FAILURE 448 449 #endif // !defined(DISABLE_PASS_THROUGH) 450 451 /** 452 * @brief This method is called by the SCI Core user to build an STP 453 * IO request. 454 * 455 * @pre 456 * - The user must have previously called scic_io_request_construct() 457 * on the supplied IO request. 458 * 459 * @param[in] scic_io_request This parameter specifies the handle to the 460 * io request object to be built. 461 * 462 * @return Indicate if the controller successfully built the IO request. 463 * @retval SCI_SUCCESS This value is returned if the IO request was 464 * successfully built. 465 * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the 466 * remote_device does not support the STP protocol. 467 * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the 468 * user did not properly set the association between the SCIC IO 469 * request and the user's IO request. Please refer to the 470 * sci_object_set_association() routine for more 471 * information. 472 */ 473 SCI_STATUS scic_io_request_construct_basic_sata( 474 SCI_IO_REQUEST_HANDLE_T scic_io_request 475 ); 476 477 /** 478 * @brief This method is called by the SCI Core user to build an STP 479 * IO request. 480 * 481 * @pre 482 * - The user must have previously called scic_io_request_construct() 483 * on the supplied IO request. 484 * 485 * @param[in] scic_io_request This parameter specifies the handle to the 486 * io request object to be built. 487 * 488 * @return Indicate if the controller successfully built the IO request. 489 * @retval SCI_SUCCESS This value is returned if the IO request was 490 * successfully built. 491 * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the 492 * remote_device does not support the STP protocol. 493 * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the 494 * user did not properly set the association between the SCIC IO 495 * request and the user's IO request. Please refer to the 496 * sci_object_set_association() routine for more 497 * information. 498 */ 499 SCI_STATUS scic_io_request_construct_advanced_sata( 500 SCI_IO_REQUEST_HANDLE_T scic_io_request, 501 SCIC_IO_SATA_PARAMETERS_T * io_parameters 502 ); 503 504 #if !defined(DISABLE_PASS_THROUGH) 505 506 /** 507 * @brief This method is called by the SCI user to build an STP pass-through 508 * IO request. 509 * 510 * @pre 511 * - The user must have previously called scic_io_request_construct() 512 * on the supplied IO request. 513 * 514 * @param[in] scic_io_request This parameter specifies the handle to the 515 * io request object to be built. 516 * 517 * @param[in] passthru_cb This parameter specifies the pointer to the callback 518 * structure that contains the function pointers 519 * 520 * @return Indicate if the controller successfully built the IO request. 521 */ 522 SCI_STATUS scic_io_request_construct_sata_pass_through( 523 SCI_IO_REQUEST_HANDLE_T scic_io_request, 524 SCIC_STP_PASSTHRU_REQUEST_CALLBACKS_T *passthru_cb 525 526 ); 527 528 #else // !defined(DISABLE_PASS_THROUGH) 529 530 #define scic_io_request_construct_sata_pass_through(io, cb) SCI_FAILURE 531 532 #endif // !defined(DISABLE_PASS_THROUGH) 533 534 /** 535 * @brief This method is called by the SCI user to build an SMP 536 * IO request. 537 * 538 * @pre 539 * - The user must have previously called scic_io_request_construct() 540 * on the supplied IO request. 541 * 542 * @param[in] scic_io_request This parameter specifies the handle to the 543 * io request object to be built. 544 * 545 * @return Indicate if the controller successfully built the IO request. 546 * @retval SCI_SUCCESS This value is returned if the IO request was 547 * successfully built. 548 * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the 549 * remote_device does not support the SMP protocol. 550 * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the 551 * user did not properly set the association between the SCIC IO 552 * request and the user's IO request. Please refer to the 553 * sci_object_set_association() routine for more 554 * information. 555 */ 556 SCI_STATUS scic_io_request_construct_smp( 557 SCI_IO_REQUEST_HANDLE_T scic_io_request 558 ); 559 560 561 /** 562 * @brief This method is called by the SCI user to build an SMP pass-through 563 * IO request. 564 * 565 * @pre 566 * - The user must have previously called scic_io_request_construct() 567 * on the supplied IO request. 568 * 569 * @param[in] scic_smp_request This parameter specifies the handle to the 570 * io request object to be built. 571 * 572 * @param[in] passthru_cb This parameter specifies the pointer to the callback 573 * structure that contains the function pointers 574 * 575 * @return Indicate if the controller successfully built the IO request. 576 */ 577 SCI_STATUS scic_io_request_construct_smp_pass_through( 578 SCI_IO_REQUEST_HANDLE_T scic_smp_request, 579 SCIC_SMP_PASSTHRU_REQUEST_CALLBACKS_T *passthru_cb 580 ); 581 582 /** 583 * @brief This method returns the controller specific IO/Task request status. 584 * These status values are unique to the specific controller being 585 * managed by the SCIC. 586 * 587 * @param[in] io_request the handle to the IO or task management request 588 * object for which to retrieve the status. 589 * 590 * @return This method returns a value indicating the controller specific 591 * request status. 592 */ 593 U32 scic_request_get_controller_status( 594 SCI_IO_REQUEST_HANDLE_T io_request 595 ); 596 597 /** 598 * @brief This method returns the user specific IO/Task request status. 599 * 600 * @param[in] io_request the handle to the IO or task management request 601 * object for which to retrieve the status. 602 * 603 * @return This method returns a value indicating the user specific 604 * request status. 605 */ 606 U32 scic_request_get_sci_status( 607 SCI_IO_REQUEST_HANDLE_T io_request 608 ); 609 610 611 /** 612 * @brief This method will return the address to the command information 613 * unit. 614 * 615 * @param[in] scic_io_request This parameter specifies the handle to the 616 * io request object to be built. 617 * 618 * @return The address of the SSP/SMP command information unit. 619 */ 620 void * scic_io_request_get_command_iu_address( 621 SCI_IO_REQUEST_HANDLE_T scic_io_request 622 ); 623 624 /** 625 * @brief This method will return the address to the response information 626 * unit. For an SSP request this buffer is only valid if the IO 627 * request is completed with the status SCI_FAILURE_IO_RESPONSE_VALID. 628 * 629 * @param[in] scic_io_request This parameter specifies the handle to the 630 * io request object to be built. 631 * 632 * @return The address of the SSP/SMP response information unit. 633 */ 634 void * scic_io_request_get_response_iu_address( 635 SCI_IO_REQUEST_HANDLE_T scic_io_request 636 ); 637 638 /** 639 * @brief This method will return the IO tag utilized by the IO request. 640 * 641 * @param[in] scic_io_request This parameter specifies the handle to the 642 * io request object for which to return the IO tag. 643 * 644 * @return An unsigned integer representing the IO tag being utilized. 645 * @retval SCI_CONTROLLER_INVALID_IO_TAG This value is returned if the IO 646 * does not currently have an IO tag allocated to it. 647 * @retval All return other values indicate a legitimate tag. 648 */ 649 U16 scic_io_request_get_io_tag( 650 SCI_IO_REQUEST_HANDLE_T scic_io_request 651 ); 652 653 /** 654 * @brief This method will inform the user of the protocol with which 655 * the supplied IO request was created. 656 * 657 * @param[in] scic_io_request This parameter specifies the IO request 658 * for which to retrieve the protocol. 659 * 660 * @return This method returns the transport protocol utilized for the 661 * the supplied request. Please refer to SCIC_TRANSPORT_PROTOCOL 662 * for more information. 663 */ 664 SCIC_TRANSPORT_PROTOCOL scic_io_request_get_protocol( 665 SCI_IO_REQUEST_HANDLE_T scic_io_request 666 ); 667 668 /** 669 * @brief This method will assign an NCQ tag to the io request object. The 670 * caller of this function must make sure that only valid NCQ tags are 671 * assigned to the io request object. 672 * 673 * @param[in] scic_io_request This parameter specifies the handle to the 674 * io request object to which to assign the ncq tag. 675 * @param[in] ncq_tag This parameter specifies the NCQ tag to be utilized 676 * for the supplied core IO request. It is up to the user to make 677 * sure that this is a valid NCQ tag. 678 * 679 * @return none 680 * 681 * @note This function is only valid for SATA NCQ requests. 682 */ 683 void scic_stp_io_request_set_ncq_tag( 684 SCI_IO_REQUEST_HANDLE_T scic_io_request, 685 U16 ncq_tag 686 ); 687 688 /** 689 * @brief This method will return the address of the host to device register 690 * fis region for the io request object. 691 * 692 * @param[in] scic_io_request This parameter specifies the handle to the io 693 * request object from which to get the host to device register fis 694 * buffer. 695 * 696 * @return The address of the host to device register fis buffer in the io 697 * request object. 698 * 699 * @note This function is only valid for SATA requests. 700 */ 701 void * scic_stp_io_request_get_h2d_reg_address( 702 SCI_IO_REQUEST_HANDLE_T scic_io_request 703 ); 704 705 /** 706 * @brief This method will return the address of the device to host register 707 * fis region for the io request object. 708 * 709 * @param[in] scic_io_request This parameter specifies the handle to the io 710 * request object from which to get the device to host register fis 711 * buffer. 712 * 713 * @return The address fo the device to host register fis ending the io 714 * request. 715 * 716 * @note This function is only valid for SATA requests. 717 */ 718 void * scic_stp_io_request_get_d2h_reg_address( 719 SCI_IO_REQUEST_HANDLE_T scic_io_request 720 ); 721 722 /** 723 * @brief This method will return the rx frame for the io request object that 724 * contains the given offset. 725 * 726 * @param[in] scic_io_request This parameter specifies the handle to the io 727 * request object which has received the frame data. 728 * @param[in] offset This parameter specifies which frame is being requested. 729 * 730 * @return The return is a pointer to the frame buffer data. 731 * 732 * @note Frame buffers are only 1024 bytes in size. Reading past the end of a 733 * frame will have unexpected results. 734 */ 735 void * scic_io_request_get_rx_frame( 736 SCI_IO_REQUEST_HANDLE_T scic_io_request, 737 U32 offset 738 ); 739 740 /** 741 * @brief This method will return the number of bytes transferred from the SCU 742 * 743 * @param[in] scic_io_request This parameter specifies the handle to the io request 744 * whose data length was not eqaul to the data length specified in the request. 745 * When the driver gets an early io completion status from the hardware, 746 * this routine should be called to get the actual number of bytes transferred 747 * 748 * @return The return is the number of bytes transferred when the data legth is not equal to 749 * the specified length in the io request 750 * 751 */ 752 U32 scic_io_request_get_number_of_bytes_transferred ( 753 SCI_IO_REQUEST_HANDLE_T scic_io_request 754 ); 755 756 #ifdef __cplusplus 757 } 758 #endif // __cplusplus 759 760 #endif // _SCIC_IO_REQUEST_H_ 761 762