isp_target.h (160978) | isp_target.h (163899) |
---|---|
1/* $FreeBSD: head/sys/dev/isp/isp_target.h 160978 2006-08-04 20:20:00Z mjacob $ */ | 1/* $FreeBSD: head/sys/dev/isp/isp_target.h 163899 2006-11-02 03:21:32Z mjacob $ */ |
2/*- 3 * Qlogic Target Mode Structure and Flag Definitions 4 * 5 * Copyright (c) 1997, 1998 6 * Patrick Stirling 7 * pms@psconsult.com 8 * All rights reserved. 9 * --- 140 unchanged lines hidden (view full) --- 150 */ 151#define TASK_FLAGS_RESERVED_MASK (0xe700) 152#define TASK_FLAGS_CLEAR_ACA (1<<14) 153#define TASK_FLAGS_TARGET_RESET (1<<13) 154#define TASK_FLAGS_LUN_RESET (1<<12) 155#define TASK_FLAGS_CLEAR_TASK_SET (1<<10) 156#define TASK_FLAGS_ABORT_TASK_SET (1<<9) 157 | 2/*- 3 * Qlogic Target Mode Structure and Flag Definitions 4 * 5 * Copyright (c) 1997, 1998 6 * Patrick Stirling 7 * pms@psconsult.com 8 * All rights reserved. 9 * --- 140 unchanged lines hidden (view full) --- 150 */ 151#define TASK_FLAGS_RESERVED_MASK (0xe700) 152#define TASK_FLAGS_CLEAR_ACA (1<<14) 153#define TASK_FLAGS_TARGET_RESET (1<<13) 154#define TASK_FLAGS_LUN_RESET (1<<12) 155#define TASK_FLAGS_CLEAR_TASK_SET (1<<10) 156#define TASK_FLAGS_ABORT_TASK_SET (1<<9) 157 |
158#ifndef MSG_ABORT 159#define MSG_ABORT 0x06 160#endif 161#ifndef MSG_BUS_DEV_RESET 162#define MSG_BUS_DEV_RESET 0x0c 163#endif 164#ifndef MSG_ABORT_TAG 165#define MSG_ABORT_TAG 0x0d 166#endif 167#ifndef MSG_CLEAR_QUEUE 168#define MSG_CLEAR_QUEUE 0x0e 169#endif 170#ifndef MSG_REL_RECOVERY 171#define MSG_REL_RECOVERY 0x10 172#endif 173#ifndef MSG_TERM_IO_PROC 174#define MSG_TERM_IO_PROC 0x11 175#endif 176#ifndef MSG_LUN_RESET 177#define MSG_LUN_RESET 0x17 178#endif | 158/* 159 * ISP24XX Immediate Notify 160 */ 161typedef struct { 162 isphdr_t in_header; 163 uint32_t in_reserved; 164 uint16_t in_nphdl; 165 uint16_t in_reserved1; 166 uint16_t in_flags; 167 uint16_t in_srr_rxid; 168 uint16_t in_status; 169 uint8_t in_status_subcode; 170 uint8_t in_reserved2; 171 uint32_t in_rxid; 172 uint16_t in_srr_reloff_lo; 173 uint16_t in_srr_reloff_hi; 174 uint16_t in_srr_iu; 175 uint16_t in_srr_oxid; 176 uint8_t in_reserved3[18]; 177 uint8_t in_reserved4; 178 uint8_t in_vpindex; 179 uint32_t in_reserved5; 180 uint16_t in_portid_lo; 181 uint8_t in_portid_hi; 182 uint8_t in_reserved6; 183 uint16_t in_reserved7; 184 uint16_t in_oxid; 185} in_fcentry_24xx_t; |
179 | 186 |
187#define IN24XX_FLAG_PUREX_IOCB 0x1 188#define IN24XX_FLAG_GLOBAL_LOGOUT 0x2 189 190#define IN24XX_LIP_RESET 0x0E 191#define IN24XX_LINK_RESET 0x0F 192#define IN24XX_PORT_LOGOUT 0x29 193#define IN24XX_PORT_CHANGED 0x2A 194#define IN24XX_LINK_FAILED 0x2E 195#define IN24XX_SRR_RCVD 0x45 196#define IN24XX_ELS_RCVD 0x46 /* 197 * login-affectin ELS received- check 198 * subcode for specific opcode 199 */ |
|
180/* 181 * Notify Acknowledge Entry structure 182 */ 183#define NA_RSVDLEN 22 184typedef struct { 185 isphdr_t na_header; 186 uint32_t na_reserved; 187 uint8_t na_lun; /* lun */ --- 42 unchanged lines hidden (view full) --- 230 uint16_t na_reserved3[NA2_RSVDLEN]; 231} na_fcentry_e_t; 232 233#define NAFC_RCOUNT 0x80 /* increment resource count */ 234#define NAFC_RST_CLRD 0x20 /* Clear LIP Reset */ 235#define NAFC_TVALID 0x10 /* task mangement response code is valid */ 236 237/* | 200/* 201 * Notify Acknowledge Entry structure 202 */ 203#define NA_RSVDLEN 22 204typedef struct { 205 isphdr_t na_header; 206 uint32_t na_reserved; 207 uint8_t na_lun; /* lun */ --- 42 unchanged lines hidden (view full) --- 250 uint16_t na_reserved3[NA2_RSVDLEN]; 251} na_fcentry_e_t; 252 253#define NAFC_RCOUNT 0x80 /* increment resource count */ 254#define NAFC_RST_CLRD 0x20 /* Clear LIP Reset */ 255#define NAFC_TVALID 0x10 /* task mangement response code is valid */ 256 257/* |
258 * ISP24XX Notify Acknowledge 259 */ 260 261typedef struct { 262 isphdr_t na_header; 263 uint32_t na_handle; 264 uint16_t na_nphdl; 265 uint16_t na_reserved1; 266 uint16_t na_flags; 267 uint16_t na_srr_rxid; 268 uint16_t na_status; 269 uint8_t na_status_subcode; 270 uint8_t na_reserved2; 271 uint32_t na_rxid; 272 uint16_t na_srr_reloff_lo; 273 uint16_t na_srr_reloff_hi; 274 uint16_t na_srr_iu; 275 uint16_t na_srr_flags; 276 uint8_t na_reserved3[18]; 277 uint8_t na_reserved4; 278 uint8_t na_vpindex; 279 uint8_t na_srr_reject_vunique; 280 uint8_t na_srr_reject_explanation; 281 uint8_t na_srr_reject_code; 282 uint8_t na_reserved5; 283 uint8_t na_reserved6[6]; 284 uint16_t na_oxid; 285} na_fcentry_24xx_t; 286 287/* |
|
238 * Accept Target I/O Entry structure 239 */ 240#define ATIO_CDBLEN 26 241 242typedef struct { 243 isphdr_t at_header; 244 uint16_t at_reserved; 245 uint16_t at_handle; --- 148 unchanged lines hidden (view full) --- 394#define IN_FC_MAKE_TAGID(tid, inst, seqid) \ 395 tid = seqid; \ 396 tid |= (inst << 16) 397 398#define FC_TAG_INSERT_INST(tid, inst) \ 399 tid &= ~0xffff; \ 400 tid |= (inst << 16) 401 | 288 * Accept Target I/O Entry structure 289 */ 290#define ATIO_CDBLEN 26 291 292typedef struct { 293 isphdr_t at_header; 294 uint16_t at_reserved; 295 uint16_t at_handle; --- 148 unchanged lines hidden (view full) --- 444#define IN_FC_MAKE_TAGID(tid, inst, seqid) \ 445 tid = seqid; \ 446 tid |= (inst << 16) 447 448#define FC_TAG_INSERT_INST(tid, inst) \ 449 tid &= ~0xffff; \ 450 tid |= (inst << 16) 451 |
452/* 453 * 24XX ATIO Definition 454 * 455 * This is *quite* different from other entry types. 456 * First of all, it has its own queue it comes in on. 457 * 458 * Secondly, it doesn't have a normal header. 459 * 460 * Thirdly, it's just a passthru of the FCP CMND IU 461 * which is recorded in big endian mode. 462 */ 463typedef struct { 464 uint8_t at_type; 465 uint8_t at_count; 466 /* 467 * Task attribute in high four bits, 468 * the rest is the FCP CMND IU Length. 469 * NB: the command can extend past the 470 * length for a single queue entry. 471 */ 472 uint16_t at_ta_len; 473 uint32_t at_rxid; 474 fc_hdr_t at_hdr; 475 fcp_cmnd_iu_t at_cmnd; 476} at7_entry_t; |
|
402 | 477 |
478 |
|
403/* 404 * Continue Target I/O Entry structure 405 * Request from driver. The response from the 406 * ISP firmware is the same except that the last 18 407 * bytes are overwritten by suggested sense data if 408 * the 'autosense valid' bit is set in the status byte. 409 */ 410typedef struct { 411 isphdr_t ct_header; | 479/* 480 * Continue Target I/O Entry structure 481 * Request from driver. The response from the 482 * ISP firmware is the same except that the last 18 483 * bytes are overwritten by suggested sense data if 484 * the 'autosense valid' bit is set in the status byte. 485 */ 486typedef struct { 487 isphdr_t ct_header; |
412 uint16_t ct_reserved; 413#define ct_syshandle ct_reserved /* we use this */ | 488 uint16_t ct_syshandle; |
414 uint16_t ct_fwhandle; /* required by f/w */ 415 uint8_t ct_lun; /* lun */ 416 uint8_t ct_iid; /* initiator id */ 417 uint8_t ct_reserved2; 418 uint8_t ct_tgt; /* our target id */ 419 uint32_t ct_flags; 420 uint8_t ct_status; /* isp status */ 421 uint8_t ct_scsi_status; /* scsi status */ 422 uint8_t ct_tag_val; /* tag value */ 423 uint8_t ct_tag_type; /* tag type */ 424 uint32_t ct_xfrlen; /* transfer length */ 425 uint32_t ct_resid; /* residual length */ 426 uint16_t ct_timeout; 427 uint16_t ct_seg_count; | 489 uint16_t ct_fwhandle; /* required by f/w */ 490 uint8_t ct_lun; /* lun */ 491 uint8_t ct_iid; /* initiator id */ 492 uint8_t ct_reserved2; 493 uint8_t ct_tgt; /* our target id */ 494 uint32_t ct_flags; 495 uint8_t ct_status; /* isp status */ 496 uint8_t ct_scsi_status; /* scsi status */ 497 uint8_t ct_tag_val; /* tag value */ 498 uint8_t ct_tag_type; /* tag type */ 499 uint32_t ct_xfrlen; /* transfer length */ 500 uint32_t ct_resid; /* residual length */ 501 uint16_t ct_timeout; 502 uint16_t ct_seg_count; |
428 /* 429 * This is so we can share tag name space with 430 * CTIO{2,3,4} with the minimum of pain. 431 */ 432 union { 433 ispds_t ct_a[ISP_RQDSEG]; 434 } _u; 435#define ct_dataseg _u.ct_a | 503 ispds_t ct_dataseg[ISP_RQDSEG]; |
436} ct_entry_t; 437 438/* 439 * For some of the dual port SCSI adapters, port (bus #) is reported 440 * in the MSbit of ct_iid. Bit fields are a bit too awkward here. 441 * 442 * Note that this does not apply to FC adapters at all which can and 443 * do report IIDs between 0x81 && 0xfe (or 0x7ff) which represent devices --- 32 unchanged lines hidden (view full) --- 476#define CT_DATA_OVER 0x09 /* (FC only) Data Overrun */ 477#define CT_RSELTMO 0x0A /* reselection timeout after 2 tries */ 478#define CT_TIMEOUT 0x0B /* timed out */ 479#define CT_RESET 0x0E /* SCSI Bus Reset occurred */ 480#define CT_PARITY 0x0F /* Uncorrectable Parity Error */ 481#define CT_BUS_ERROR 0x10 /* (FC Only) DMA PCI Error */ 482#define CT_PANIC 0x13 /* Unrecoverable Error */ 483#define CT_PHASE_ERROR 0x14 /* Bus phase sequence error */ | 504} ct_entry_t; 505 506/* 507 * For some of the dual port SCSI adapters, port (bus #) is reported 508 * in the MSbit of ct_iid. Bit fields are a bit too awkward here. 509 * 510 * Note that this does not apply to FC adapters at all which can and 511 * do report IIDs between 0x81 && 0xfe (or 0x7ff) which represent devices --- 32 unchanged lines hidden (view full) --- 544#define CT_DATA_OVER 0x09 /* (FC only) Data Overrun */ 545#define CT_RSELTMO 0x0A /* reselection timeout after 2 tries */ 546#define CT_TIMEOUT 0x0B /* timed out */ 547#define CT_RESET 0x0E /* SCSI Bus Reset occurred */ 548#define CT_PARITY 0x0F /* Uncorrectable Parity Error */ 549#define CT_BUS_ERROR 0x10 /* (FC Only) DMA PCI Error */ 550#define CT_PANIC 0x13 /* Unrecoverable Error */ 551#define CT_PHASE_ERROR 0x14 /* Bus phase sequence error */ |
484#define CT_BDR_MSG 0x17 /* Bus Device Reset msg received */ | |
485#define CT_DATA_UNDER 0x15 /* (FC only) Data Underrun */ | 552#define CT_DATA_UNDER 0x15 /* (FC only) Data Underrun */ |
553#define CT_BDR_MSG 0x17 /* Bus Device Reset msg received */ |
|
486#define CT_TERMINATED 0x19 /* due to Terminate Transfer mbox cmd */ | 554#define CT_TERMINATED 0x19 /* due to Terminate Transfer mbox cmd */ |
487#define CT_PORTNOTAVAIL 0x28 /* port not available */ | 555#define CT_PORTUNAVAIL 0x28 /* port not available */ |
488#define CT_LOGOUT 0x29 /* port logout */ 489#define CT_PORTCHANGED 0x2A /* port changed */ 490#define CT_IDE 0x33 /* Initiator Detected Error */ 491#define CT_NOACK 0x35 /* Outstanding Immed. Notify. entry */ 492#define CT_SRR 0x45 /* SRR Received */ 493#define CT_LUN_RESET 0x48 /* Lun Reset Received */ 494 495/* --- 12 unchanged lines hidden (view full) --- 508#define UINT32_ENTRY_SIZE (sizeof(at_entry_t)/sizeof(uint32_t)) 509 510/* 511 * QLA2100 CTIO (type 2) entry 512 */ 513#define MAXRESPLEN 26 514typedef struct { 515 isphdr_t ct_header; | 556#define CT_LOGOUT 0x29 /* port logout */ 557#define CT_PORTCHANGED 0x2A /* port changed */ 558#define CT_IDE 0x33 /* Initiator Detected Error */ 559#define CT_NOACK 0x35 /* Outstanding Immed. Notify. entry */ 560#define CT_SRR 0x45 /* SRR Received */ 561#define CT_LUN_RESET 0x48 /* Lun Reset Received */ 562 563/* --- 12 unchanged lines hidden (view full) --- 576#define UINT32_ENTRY_SIZE (sizeof(at_entry_t)/sizeof(uint32_t)) 577 578/* 579 * QLA2100 CTIO (type 2) entry 580 */ 581#define MAXRESPLEN 26 582typedef struct { 583 isphdr_t ct_header; |
516 uint16_t ct_reserved; 517 uint16_t ct_fwhandle; /* just to match CTIO */ | 584 uint32_t ct_syshandle; |
518 uint8_t ct_lun; /* lun */ 519 uint8_t ct_iid; /* initiator id */ 520 uint16_t ct_rxid; /* response ID */ 521 uint16_t ct_flags; 522 uint16_t ct_status; /* isp status */ 523 uint16_t ct_timeout; 524 uint16_t ct_seg_count; 525 uint32_t ct_reloff; /* relative offset */ --- 13 unchanged lines hidden (view full) --- 539 * in system memory as located by the isp_dataseg. 540 */ 541 struct { 542 uint32_t _reserved; 543 uint16_t _reserved2; 544 uint16_t ct_scsi_status; 545 uint32_t ct_xfrlen; 546 union { | 585 uint8_t ct_lun; /* lun */ 586 uint8_t ct_iid; /* initiator id */ 587 uint16_t ct_rxid; /* response ID */ 588 uint16_t ct_flags; 589 uint16_t ct_status; /* isp status */ 590 uint16_t ct_timeout; 591 uint16_t ct_seg_count; 592 uint32_t ct_reloff; /* relative offset */ --- 13 unchanged lines hidden (view full) --- 606 * in system memory as located by the isp_dataseg. 607 */ 608 struct { 609 uint32_t _reserved; 610 uint16_t _reserved2; 611 uint16_t ct_scsi_status; 612 uint32_t ct_xfrlen; 613 union { |
547 ispds_t ct_a[ISP_RQDSEG_T2]; /* CTIO2 */ 548 ispds64_t ct_b[ISP_RQDSEG_T3]; /* CTIO3 */ 549 ispdslist_t ct_c; /* CTIO4 */ 550 } _u; 551#define ct_dataseg _u.ct_a 552#define ct_dataseg64 _u.ct_b 553#define ct_dslist _u.ct_c | 614 ispds_t ct_dataseg[ISP_RQDSEG_T2]; 615 ispds64_t ct_dataseg64[ISP_RQDSEG_T3]; 616 ispdslist_t ct_dslist; 617 } u; |
554 } m0; 555 struct { 556 uint16_t _reserved; 557 uint16_t _reserved2; 558 uint16_t ct_senselen; 559 uint16_t ct_scsi_status; 560 uint16_t ct_resplen; 561 uint8_t ct_resp[MAXRESPLEN]; --- 5 unchanged lines hidden (view full) --- 567 uint32_t ct_datalen; 568 ispds_t ct_fcp_rsp_iudata; 569 } m2; 570 } rsp; 571} ct2_entry_t; 572 573typedef struct { 574 isphdr_t ct_header; | 618 } m0; 619 struct { 620 uint16_t _reserved; 621 uint16_t _reserved2; 622 uint16_t ct_senselen; 623 uint16_t ct_scsi_status; 624 uint16_t ct_resplen; 625 uint8_t ct_resp[MAXRESPLEN]; --- 5 unchanged lines hidden (view full) --- 631 uint32_t ct_datalen; 632 ispds_t ct_fcp_rsp_iudata; 633 } m2; 634 } rsp; 635} ct2_entry_t; 636 637typedef struct { 638 isphdr_t ct_header; |
575 uint16_t ct_reserved; 576 uint16_t ct_fwhandle; /* just to match CTIO */ | 639 uint32_t ct_syshandle; |
577 uint16_t ct_iid; /* initiator id */ 578 uint16_t ct_rxid; /* response ID */ 579 uint16_t ct_flags; 580 uint16_t ct_status; /* isp status */ 581 uint16_t ct_timeout; 582 uint16_t ct_seg_count; 583 uint32_t ct_reloff; /* relative offset */ 584 int32_t ct_resid; /* residual length */ 585 union { 586 struct { 587 uint32_t _reserved; 588 uint16_t _reserved2; 589 uint16_t ct_scsi_status; 590 uint32_t ct_xfrlen; 591 union { | 640 uint16_t ct_iid; /* initiator id */ 641 uint16_t ct_rxid; /* response ID */ 642 uint16_t ct_flags; 643 uint16_t ct_status; /* isp status */ 644 uint16_t ct_timeout; 645 uint16_t ct_seg_count; 646 uint32_t ct_reloff; /* relative offset */ 647 int32_t ct_resid; /* residual length */ 648 union { 649 struct { 650 uint32_t _reserved; 651 uint16_t _reserved2; 652 uint16_t ct_scsi_status; 653 uint32_t ct_xfrlen; 654 union { |
592 ispds_t ct_a[ISP_RQDSEG_T2]; /* CTIO2 */ 593 ispds64_t ct_b[ISP_RQDSEG_T3]; /* CTIO3 */ 594 ispdslist_t ct_c; /* CTIO4 */ 595 } _u; | 655 ispds_t ct_dataseg[ISP_RQDSEG_T2]; 656 ispds64_t ct_dataseg64[ISP_RQDSEG_T3]; 657 ispdslist_t ct_dslist; 658 } u; |
596 } m0; 597 struct { 598 uint16_t _reserved; 599 uint16_t _reserved2; 600 uint16_t ct_senselen; 601 uint16_t ct_scsi_status; 602 uint16_t ct_resplen; 603 uint8_t ct_resp[MAXRESPLEN]; --- 6 unchanged lines hidden (view full) --- 610 ispds_t ct_fcp_rsp_iudata; 611 } m2; 612 } rsp; 613} ct2e_entry_t; 614 615/* 616 * ct_flags values for CTIO2 617 */ | 659 } m0; 660 struct { 661 uint16_t _reserved; 662 uint16_t _reserved2; 663 uint16_t ct_senselen; 664 uint16_t ct_scsi_status; 665 uint16_t ct_resplen; 666 uint8_t ct_resp[MAXRESPLEN]; --- 6 unchanged lines hidden (view full) --- 673 ispds_t ct_fcp_rsp_iudata; 674 } m2; 675 } rsp; 676} ct2e_entry_t; 677 678/* 679 * ct_flags values for CTIO2 680 */ |
618#define CT2_FLAG_MMASK 0x0003 | |
619#define CT2_FLAG_MODE0 0x0000 620#define CT2_FLAG_MODE1 0x0001 621#define CT2_FLAG_MODE2 0x0002 | 681#define CT2_FLAG_MODE0 0x0000 682#define CT2_FLAG_MODE1 0x0001 683#define CT2_FLAG_MODE2 0x0002 |
622#define CT2_DATA_IN CT_DATA_IN 623#define CT2_DATA_OUT CT_DATA_OUT 624#define CT2_NO_DATA CT_NO_DATA 625#define CT2_DATAMASK CT_DATAMASK | 684#define CT2_FLAG_MMASK 0x0003 685#define CT2_DATA_IN 0x0040 686#define CT2_DATA_OUT 0x0080 687#define CT2_NO_DATA 0x00C0 688#define CT2_DATAMASK 0x00C0 |
626#define CT2_CCINCR 0x0100 627#define CT2_FASTPOST 0x0200 | 689#define CT2_CCINCR 0x0100 690#define CT2_FASTPOST 0x0200 |
691#define CT2_CONFIRM 0x2000 |
|
628#define CT2_TERMINATE 0x4000 629#define CT2_SENDSTATUS 0x8000 630 631/* 632 * ct_status values are (mostly) the same as that for ct_entry. 633 */ 634 635/* 636 * ct_scsi_status values- the low 8 bits are the normal SCSI status 637 * we know and love. The upper 8 bits are validity markers for FCP_RSP_IU 638 * fields. 639 */ 640#define CT2_RSPLEN_VALID 0x0100 641#define CT2_SNSLEN_VALID 0x0200 642#define CT2_DATA_OVER 0x0400 643#define CT2_DATA_UNDER 0x0800 644 645/* | 692#define CT2_TERMINATE 0x4000 693#define CT2_SENDSTATUS 0x8000 694 695/* 696 * ct_status values are (mostly) the same as that for ct_entry. 697 */ 698 699/* 700 * ct_scsi_status values- the low 8 bits are the normal SCSI status 701 * we know and love. The upper 8 bits are validity markers for FCP_RSP_IU 702 * fields. 703 */ 704#define CT2_RSPLEN_VALID 0x0100 705#define CT2_SNSLEN_VALID 0x0200 706#define CT2_DATA_OVER 0x0400 707#define CT2_DATA_UNDER 0x0800 708 709/* |
710 * ISP24XX CTIO 711 */ 712#define MAXRESPLEN_24XX 24 713typedef struct { 714 isphdr_t ct_header; 715 uint32_t ct_syshandle; 716 uint16_t ct_nphdl; /* status on returned CTIOs */ 717 uint16_t ct_timeout; 718 uint16_t ct_seg_count; 719 uint8_t ct_vpindex; 720 uint8_t ct_xflags; 721 uint16_t ct_iid_lo; /* low 16 bits of portid */ 722 uint8_t ct_iid_hi; /* hi 8 bits of portid */ 723 uint8_t ct_reserved; 724 uint32_t ct_rxid; 725 uint16_t ct_senselen; /* mode 0 only */ 726 uint16_t ct_flags; 727 int32_t ct_resid; /* residual length */ 728 uint16_t ct_oxid; 729 uint16_t ct_scsi_status; /* modes 0 && 1 only */ 730 union { 731 struct { 732 uint32_t reloff; 733 uint32_t reserved0; 734 uint32_t ct_xfrlen; 735 uint32_t reserved1; 736 ispds64_t ds; 737 } m0; 738 struct { 739 uint16_t ct_resplen; 740 uint16_t reserved; 741 uint8_t ct_resp[MAXRESPLEN_24XX]; 742 } m1; 743 struct { 744 uint32_t reserved0; 745 uint32_t ct_datalen; 746 uint32_t reserved1; 747 ispds64_t ct_fcp_rsp_iudata; 748 } m2; 749 } rsp; 750} ct7_entry_t; 751 752/* 753 * ct_flags values for CTIO7 754 */ 755#define CT7_DATA_IN 0x0002 756#define CT7_DATA_OUT 0x0001 757#define CT7_NO_DATA 0x0000 758#define CT7_DATAMASK 0x003 759#define CT7_DSD_ENABLE 0x0004 760#define CT7_CONF_STSFD 0x0010 761#define CT7_EXPLCT_CONF 0x0020 762#define CT7_FLAG_MODE0 0x0000 763#define CT7_FLAG_MODE1 0x0040 764#define CT7_FLAG_MODE7 0x0080 765#define CT7_FLAG_MMASK 0x00C0 766#define CT7_FASTPOST 0x0100 767#define CT7_ATTR_MASK 0x1e00 /* task attributes from atio7 */ 768#define CT7_CONFIRM 0x2000 769#define CT7_TERMINATE 0x4000 770#define CT7_SENDSTATUS 0x8000 771 772/* 773 * Type 7 CTIO status codes 774 */ 775#define CT7_OK 0x01 /* completed without error */ 776#define CT7_ABORTED 0x02 /* aborted by host */ 777#define CT7_ERR 0x04 /* see sense data for error */ 778#define CT7_INVAL 0x06 /* request for disabled lun */ 779#define CT7_INVRXID 0x08 /* (FC only) Invalid RX_ID */ 780#define CT7_DATA_OVER 0x09 /* (FC only) Data Overrun */ 781#define CT7_TIMEOUT 0x0B /* timed out */ 782#define CT7_RESET 0x0E /* LIP Rset Received */ 783#define CT7_BUS_ERROR 0x10 /* DMA PCI Error */ 784#define CT7_REASSY_ERR 0x11 /* DMA reassembly error */ 785#define CT7_DATA_UNDER 0x15 /* (FC only) Data Underrun */ 786#define CT7_PORTUNAVAIL 0x28 /* port not available */ 787#define CT7_LOGOUT 0x29 /* port logout */ 788#define CT7_PORTCHANGED 0x2A /* port changed */ 789#define CT7_SRR 0x45 /* SRR Received */ 790 791/* 792 * Other 24XX related target IOCBs 793 */ 794 795/* 796 * ABTS Received 797 */ 798typedef struct { 799 isphdr_t abts_header; 800 uint8_t abts_reserved0[6]; 801 uint16_t abts_nphdl; 802 uint16_t abts_reserved1; 803 uint16_t abts_sof; 804 uint32_t abts_rxid_abts; 805 uint16_t abts_did_lo; 806 uint8_t abts_did_hi; 807 uint8_t abts_r_ctl; 808 uint16_t abts_sid_lo; 809 uint8_t abts_sid_hi; 810 uint8_t abts_cs_ctl; 811 uint16_t abts_fs_ctl; 812 uint8_t abts_f_ctl; 813 uint8_t abts_type; 814 uint16_t abts_seq_cnt; 815 uint8_t abts_df_ctl; 816 uint8_t abts_seq_id; 817 uint16_t abts_rx_id; 818 uint16_t abts_ox_id; 819 uint32_t abts_param; 820 uint8_t abts_reserved2[16]; 821 uint32_t abts_rxid_task; 822} abts_t; 823 824typedef struct { 825 isphdr_t abts_rsp_header; 826 uint32_t abts_rsp_handle; 827 uint16_t abts_rsp_status; 828 uint16_t abts_rsp_nphdl; 829 uint16_t abts_rsp_ctl_flags; 830 uint16_t abts_rsp_sof; 831 uint32_t abts_rsp_rxid_abts; 832 uint16_t abts_rsp_did_lo; 833 uint8_t abts_rsp_did_hi; 834 uint8_t abts_rsp_r_ctl; 835 uint16_t abts_rsp_sid_lo; 836 uint8_t abts_rsp_sid_hi; 837 uint8_t abts_rsp_cs_ctl; 838 uint16_t abts_rsp_f_ctl_lo; 839 uint8_t abts_rsp_f_ctl_hi; 840 uint8_t abts_rsp_type; 841 uint16_t abts_rsp_seq_cnt; 842 uint8_t abts_rsp_df_ctl; 843 uint8_t abts_rsp_seq_id; 844 uint16_t abts_rsp_rx_id; 845 uint16_t abts_rsp_ox_id; 846 uint32_t abts_rsp_param; 847 union { 848 struct { 849 uint16_t reserved; 850 uint8_t last_seq_id; 851 uint8_t seq_id_valid; 852 uint16_t aborted_rx_id; 853 uint16_t aborted_ox_id; 854 uint16_t high_seq_cnt; 855 uint16_t low_seq_cnt; 856 uint8_t reserved2[4]; 857 } ba_acc; 858 struct { 859 uint8_t vendor_unique; 860 uint8_t explanation; 861 uint8_t reason; 862 uint8_t reserved; 863 uint8_t reserved2[12]; 864 } ba_rjt; 865 struct { 866 uint8_t reserved[8]; 867 uint32_t subcode1; 868 uint32_t subcode2; 869 } rsp; 870 uint8_t reserved[16]; 871 } abts_rsp_payload; 872 uint32_t abts_rsp_rxid_task; 873} abts_rsp_t; 874 875/* terminate this ABTS exchange */ 876#define ISP24XX_ABTS_RSP_TERMINATE 0x01 877 878#define ISP24XX_ABTS_RSP_COMPLETE 0x00 879#define ISP24XX_ABTS_RSP_RESET 0x04 880#define ISP24XX_ABTS_RSP_ABORTED 0x05 881#define ISP24XX_ABTS_RSP_TIMEOUT 0x06 882#define ISP24XX_ABTS_RSP_INVXID 0x08 883#define ISP24XX_ABTS_RSP_LOGOUT 0x29 884#define ISP24XX_ABTS_RSP_SUBCODE 0x31 885 886/* |
|
646 * Debug macros 647 */ 648 649#define ISP_TDQE(isp, msg, idx, arg) \ 650 if (isp->isp_dblev & ISP_LOGTDEBUG2) isp_print_qentry(isp, msg, idx, arg) 651 | 887 * Debug macros 888 */ 889 890#define ISP_TDQE(isp, msg, idx, arg) \ 891 if (isp->isp_dblev & ISP_LOGTDEBUG2) isp_print_qentry(isp, msg, idx, arg) 892 |
893#ifndef ISP_TOOLS |
|
652/* 653 * The functions below are for the publicly available 654 * target mode functions that are internal to the Qlogic driver. 655 */ 656 657/* 658 * This function handles new response queue entry appropriate for target mode. 659 */ | 894/* 895 * The functions below are for the publicly available 896 * target mode functions that are internal to the Qlogic driver. 897 */ 898 899/* 900 * This function handles new response queue entry appropriate for target mode. 901 */ |
660int isp_target_notify(ispsoftc_t *, void *, uint16_t *); | 902int isp_target_notify(ispsoftc_t *, void *, uint32_t *); |
661 662/* 663 * This function externalizes the ability to acknowledge an Immediate Notify 664 * request. 665 */ 666void isp_notify_ack(ispsoftc_t *, void *); 667 668/* --- 16 unchanged lines hidden (view full) --- 685 * or ATIO2. 686 */ 687int isp_target_put_atio(ispsoftc_t *, void *); 688 689/* 690 * General routine to send a final CTIO for a command- used mostly for 691 * local responses. 692 */ | 903 904/* 905 * This function externalizes the ability to acknowledge an Immediate Notify 906 * request. 907 */ 908void isp_notify_ack(ispsoftc_t *, void *); 909 910/* --- 16 unchanged lines hidden (view full) --- 927 * or ATIO2. 928 */ 929int isp_target_put_atio(ispsoftc_t *, void *); 930 931/* 932 * General routine to send a final CTIO for a command- used mostly for 933 * local responses. 934 */ |
693int isp_endcmd(ispsoftc_t *, void *, uint32_t, uint16_t); | 935int isp_endcmd(ispsoftc_t *, void *, uint32_t, uint32_t); |
694#define ECMD_SVALID 0x100 695 696/* 697 * Handle an asynchronous event 698 * 699 * Return nonzero if the interrupt that generated this event has been dismissed. 700 */ 701int isp_target_async(ispsoftc_t *, int, int); | 936#define ECMD_SVALID 0x100 937 938/* 939 * Handle an asynchronous event 940 * 941 * Return nonzero if the interrupt that generated this event has been dismissed. 942 */ 943int isp_target_async(ispsoftc_t *, int, int); |
702 | 944#endif |
703#endif /* _ISP_TARGET_H */ | 945#endif /* _ISP_TARGET_H */ |