1/*- 2 * Machine and OS Independent Target Mode Code for the Qlogic SCSI/FC adapters. 3 * |
4 * Copyright (c) 1997-2006 by Matthew Jacob |
5 * All rights reserved. |
6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice immediately at the beginning of the file, without modification, 12 * this list of conditions, and the following disclaimer. 13 * 2. The name of the author may not be used to endorse or promote products --- 19 unchanged lines hidden (view full) --- 33/* 34 * Include header file appropriate for platform we're building on. 35 */ 36 37#ifdef __NetBSD__ 38#include <dev/ic/isp_netbsd.h> 39#endif 40#ifdef __FreeBSD__ |
41#include <sys/cdefs.h> 42__FBSDID("$FreeBSD: head/sys/dev/isp/isp_target.c 154704 2006-01-23 06:23:37Z mjacob $"); 43 |
44#include <dev/isp/isp_freebsd.h> 45#endif 46#ifdef __OpenBSD__ 47#include <dev/ic/isp_openbsd.h> 48#endif 49#ifdef __linux__ 50#include "isp_linux.h" 51#endif 52 53#ifdef ISP_TARGET_MODE 54static const char atiocope[] = 55 "ATIO returned for lun %d because it was in the middle of Bus Device Reset " 56 "on bus %d"; 57static const char atior[] = 58 "ATIO returned on for lun %d on from IID %d because a Bus Reset occurred " 59 "on bus %d"; 60 |
61static void isp_got_msg(struct ispsoftc *, in_entry_t *); 62static void isp_got_msg_fc(struct ispsoftc *, in_fcentry_t *); |
63static void isp_handle_atio(struct ispsoftc *, at_entry_t *); 64static void isp_handle_atio2(struct ispsoftc *, at2_entry_t *); 65static void isp_handle_ctio(struct ispsoftc *, ct_entry_t *); 66static void isp_handle_ctio2(struct ispsoftc *, ct2_entry_t *); 67 68/* 69 * The Qlogic driver gets an interrupt to look at response queue entries. 70 * Some of these are status completions for initiatior mode commands, but --- 42 unchanged lines hidden (view full) --- 113 114int 115isp_target_notify(struct ispsoftc *isp, void *vptr, u_int16_t *optrp) 116{ 117 u_int16_t status, seqid; 118 union { 119 at_entry_t *atiop; 120 at2_entry_t *at2iop; |
121 at2e_entry_t *at2eiop; |
122 ct_entry_t *ctiop; 123 ct2_entry_t *ct2iop; |
124 ct2e_entry_t *ct2eiop; |
125 lun_entry_t *lunenp; 126 in_entry_t *inotp; 127 in_fcentry_t *inot_fcp; |
128 in_fcentry_e_t *inote_fcp; |
129 na_entry_t *nackp; 130 na_fcentry_t *nack_fcp; |
131 na_fcentry_e_t *nacke_fcp; |
132 isphdr_t *hp; 133 void * *vp; 134#define atiop unp.atiop 135#define at2iop unp.at2iop |
136#define at2eiop unp.at2eiop |
137#define ctiop unp.ctiop 138#define ct2iop unp.ct2iop |
139#define ct2eiop unp.ct2eiop |
140#define lunenp unp.lunenp 141#define inotp unp.inotp 142#define inot_fcp unp.inot_fcp |
143#define inote_fcp unp.inote_fcp |
144#define nackp unp.nackp 145#define nack_fcp unp.nack_fcp |
146#define nacke_fcp unp.nacke_fcp |
147#define hdrp unp.hp 148 } unp; 149 u_int8_t local[QENTRY_LEN]; 150 int bus, type, rval = 1; 151 152 type = isp_get_response_type(isp, (isphdr_t *)vptr); 153 unp.vp = vptr; 154 --- 4 unchanged lines hidden (view full) --- 159 isp_get_atio(isp, atiop, (at_entry_t *) local); 160 isp_handle_atio(isp, (at_entry_t *) local); 161 break; 162 case RQSTYPE_CTIO: 163 isp_get_ctio(isp, ctiop, (ct_entry_t *) local); 164 isp_handle_ctio(isp, (ct_entry_t *) local); 165 break; 166 case RQSTYPE_ATIO2: |
167 if (IS_2KLOGIN(isp)) 168 isp_get_atio2e(isp, at2eiop, (at2e_entry_t *) local); 169 else 170 isp_get_atio2(isp, at2iop, (at2_entry_t *) local); |
171 isp_handle_atio2(isp, (at2_entry_t *) local); 172 break; 173 case RQSTYPE_CTIO3: 174 case RQSTYPE_CTIO2: |
175 if (IS_2KLOGIN(isp)) 176 isp_get_ctio2e(isp, ct2eiop, (ct2e_entry_t *) local); 177 else 178 isp_get_ctio2(isp, ct2iop, (ct2_entry_t *) local); |
179 isp_handle_ctio2(isp, (ct2_entry_t *) local); 180 break; 181 case RQSTYPE_ENABLE_LUN: 182 case RQSTYPE_MODIFY_LUN: 183 isp_get_enable_lun(isp, lunenp, (lun_entry_t *) local); 184 (void) isp_async(isp, ISPASYNC_TARGET_ACTION, local); 185 break; 186 187 case RQSTYPE_NOTIFY: 188 /* 189 * Either the ISP received a SCSI message it can't 190 * handle, or it's returning an Immed. Notify entry 191 * we sent. We can send Immed. Notify entries to 192 * increment the firmware's resource count for them 193 * (we set this initially in the Enable Lun entry). 194 */ 195 bus = 0; 196 if (IS_FC(isp)) { |
197 if (IS_2KLOGIN(isp)) 198 isp_get_notify_fc_e(isp, inote_fcp, (in_fcentry_e_t *)local); 199 isp_get_notify_fc(isp, inot_fcp, (in_fcentry_t *)local); |
200 inot_fcp = (in_fcentry_t *) local; 201 status = inot_fcp->in_status; 202 seqid = inot_fcp->in_seqid; 203 } else { 204 isp_get_notify(isp, inotp, (in_entry_t *)local); 205 inotp = (in_entry_t *) local; 206 status = inotp->in_status & 0xff; 207 seqid = inotp->in_seqid; 208 if (IS_DUALBUS(isp)) { 209 bus = GET_BUS_VAL(inotp->in_iid); 210 SET_BUS_VAL(inotp->in_iid, 0); 211 } 212 } 213 isp_prt(isp, ISP_LOGTDEBUG0, 214 "Immediate Notify On Bus %d, status=0x%x seqid=0x%x", 215 bus, status, seqid); 216 |
217 switch (status) { |
218 case IN_MSG_RECEIVED: 219 case IN_IDE_RECEIVED: 220 if (IS_FC(isp)) { |
221 isp_got_msg_fc(isp, (in_fcentry_t *)local); |
222 } else { |
223 isp_got_msg(isp, (in_entry_t *)local); |
224 } 225 break; 226 case IN_RSRC_UNAVAIL: 227 isp_prt(isp, ISP_LOGWARN, "Firmware out of ATIOs"); |
228 isp_notify_ack(isp, local); |
229 break; |
230 case IN_RESET: 231 isp_target_async(isp, 0, ASYNC_BUS_RESET); 232 break; |
233 case IN_PORT_LOGOUT: 234 case IN_ABORT_TASK: 235 case IN_PORT_CHANGED: 236 case IN_GLOBAL_LOGO: 237 (void) isp_async(isp, ISPASYNC_TARGET_ACTION, &local); 238 break; 239 default: 240 isp_prt(isp, ISP_LOGERR, 241 "bad status (0x%x) in isp_target_notify", status); |
242 isp_notify_ack(isp, local); |
243 break; 244 } 245 break; 246 247 case RQSTYPE_NOTIFY_ACK: 248 /* 249 * The ISP is acknowledging our acknowledgement of an 250 * Immediate Notify entry for some asynchronous event. 251 */ 252 if (IS_FC(isp)) { |
253 if (IS_2KLOGIN(isp)) 254 isp_get_notify_ack_fc_e(isp, nacke_fcp, 255 (na_fcentry_e_t *)local); 256 else 257 isp_get_notify_ack_fc(isp, nack_fcp, 258 (na_fcentry_t *)local); |
259 nack_fcp = (na_fcentry_t *)local; 260 isp_prt(isp, ISP_LOGTDEBUG1, 261 "Notify Ack status=0x%x seqid 0x%x", 262 nack_fcp->na_status, nack_fcp->na_seqid); 263 } else { 264 isp_get_notify_ack(isp, nackp, (na_entry_t *)local); 265 nackp = (na_entry_t *)local; 266 isp_prt(isp, ISP_LOGTDEBUG1, --- 4 unchanged lines hidden (view full) --- 271 default: 272 isp_prt(isp, ISP_LOGERR, 273 "Unknown entry type 0x%x in isp_target_notify", type); 274 rval = 0; 275 break; 276 } 277#undef atiop 278#undef at2iop |
279#undef at2eiop |
280#undef ctiop 281#undef ct2iop |
282#undef ct2eiop |
283#undef lunenp 284#undef inotp 285#undef inot_fcp |
286#undef inote_fcp |
287#undef nackp 288#undef nack_fcp |
289#undef nacke_fcp |
290#undef hdrp 291 return (rval); 292} 293 294 295/* 296 * Toggle (on/off) target mode for bus/target/lun 297 * --- 94 unchanged lines hidden (view full) --- 392} 393 394int 395isp_target_put_atio(struct ispsoftc *isp, void *arg) 396{ 397 union { 398 at_entry_t _atio; 399 at2_entry_t _atio2; |
400 at2e_entry_t _atio2e; |
401 } atun; 402 403 MEMZERO(&atun, sizeof atun); 404 if (IS_FC(isp)) { 405 at2_entry_t *aep = arg; 406 atun._atio2.at_header.rqs_entry_type = RQSTYPE_ATIO2; 407 atun._atio2.at_header.rqs_entry_count = 1; 408 if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) { 409 atun._atio2.at_scclun = (u_int16_t) aep->at_scclun; 410 } else { 411 atun._atio2.at_lun = (u_int8_t) aep->at_lun; 412 } |
413 if (IS_2KLOGIN(isp)) { 414 atun._atio2e.at_iid = ((at2e_entry_t *)aep)->at_iid; 415 } else { 416 atun._atio2.at_iid = aep->at_iid; 417 } |
418 atun._atio2.at_rxid = aep->at_rxid; 419 atun._atio2.at_status = CT_OK; 420 } else { 421 at_entry_t *aep = arg; 422 atun._atio.at_header.rqs_entry_type = RQSTYPE_ATIO; 423 atun._atio.at_header.rqs_entry_count = 1; 424 atun._atio.at_handle = aep->at_handle; 425 atun._atio.at_iid = aep->at_iid; --- 27 unchanged lines hidden (view full) --- 453 454int 455isp_endcmd(struct ispsoftc *isp, void *arg, u_int32_t code, u_int16_t hdl) 456{ 457 int sts; 458 union { 459 ct_entry_t _ctio; 460 ct2_entry_t _ctio2; |
461 ct2e_entry_t _ctio2e; |
462 } un; 463 464 MEMZERO(&un, sizeof un); 465 sts = code & 0xff; 466 467 if (IS_FC(isp)) { 468 at2_entry_t *aep = arg; 469 ct2_entry_t *cto = &un._ctio2; 470 471 cto->ct_header.rqs_entry_type = RQSTYPE_CTIO2; 472 cto->ct_header.rqs_entry_count = 1; |
473 if ((FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) == 0) { 474 cto->ct_lun = aep->at_lun; 475 } |
476 if (IS_2KLOGIN(isp)) { 477 un._ctio2e.ct_iid = ((at2e_entry_t *)aep)->at_iid; 478 } else { 479 cto->ct_iid = aep->at_iid; 480 } |
481 cto->ct_rxid = aep->at_rxid; 482 cto->rsp.m1.ct_scsi_status = sts; 483 cto->ct_flags = CT2_SENDSTATUS | CT2_NO_DATA | CT2_FLAG_MODE1; 484 if (hdl == 0) { 485 cto->ct_flags |= CT2_CCINCR; 486 } 487 if (aep->at_datalen) { 488 cto->ct_resid = aep->at_datalen; --- 32 unchanged lines hidden (view full) --- 521 cto->ct_syshandle = hdl; 522 } 523 return (isp_target_put_entry(isp, &un)); 524} 525 526int 527isp_target_async(struct ispsoftc *isp, int bus, int event) 528{ |
529 tmd_notify_t notify; |
530 |
531 MEMZERO(¬ify, sizeof (tmd_notify_t)); 532 notify.nt_hba = isp; 533 /* nt_str set in outer layers */ 534 notify.nt_iid = INI_ANY; 535 /* nt_tgt set in outer layers */ 536 notify.nt_lun = LUN_ANY; 537 notify.nt_tagval = TAG_ANY; 538 539 if (IS_SCSI(isp)) { 540 TAG_INSERT_BUS(notify.nt_tagval, bus); 541 } 542 |
543 switch (event) { |
544 case ASYNC_LOOP_UP: |
545 case ASYNC_PTPMODE: 546 notify.nt_ncode = NT_LINK_UP; 547 (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); 548 break; |
549 case ASYNC_LOOP_DOWN: |
550 notify.nt_ncode = NT_LINK_DOWN; 551 (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); 552 break; 553 case ASYNC_LIP_F8: 554 case ASYNC_LIP_OCCURRED: |
555 case ASYNC_LOOP_RESET: |
556 notify.nt_ncode = NT_LIP_RESET; 557 (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); 558 break; |
559 case ASYNC_BUS_RESET: |
560 case ASYNC_TIMEOUT_RESET: /* XXX: where does this come from ? */ 561 notify.nt_ncode = NT_BUS_RESET; 562 (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); |
563 break; 564 case ASYNC_DEVICE_RESET: |
565 notify.nt_ncode = NT_TARGET_RESET; 566 (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, ¬ify); 567 break; 568 case ASYNC_CTIO_DONE: 569 { 570 uint8_t storage[QENTRY_LEN]; 571 memset(storage, 0, QENTRY_LEN); |
572 if (IS_FC(isp)) { |
573 ct2_entry_t *ct = (ct2_entry_t *) storage; 574 ct->ct_header.rqs_entry_type = RQSTYPE_CTIO2; 575 ct->ct_status = CT_OK; 576 ct->ct_syshandle = bus; 577 ct->ct_flags = CT2_SENDSTATUS|CT2_FASTPOST; |
578 } else { |
579 ct_entry_t *ct = (ct_entry_t *) storage; 580 ct->ct_header.rqs_entry_type = RQSTYPE_CTIO; 581 ct->ct_status = CT_OK; 582 ct->ct_fwhandle = bus; 583 ct->ct_flags = CT_SENDSTATUS; |
584 } |
585 (void) isp_async(isp, ISPASYNC_TARGET_ACTION, storage); |
586 return (0); |
587 } |
588 default: 589 isp_prt(isp, ISP_LOGERR, 590 "isp_target_async: unknown event 0x%x", event); |
591 if (isp->isp_state == ISP_RUNSTATE) { 592 isp_notify_ack(isp, NULL); 593 } |
594 break; 595 } |
596 return (0); |
597} 598 599 600/* 601 * Process a received message. 602 * The ISP firmware can handle most messages, there are only 603 * a few that we need to deal with: 604 * - abort: clean up the current command 605 * - abort tag and clear queue 606 */ 607 608static void |
609isp_got_msg(struct ispsoftc *isp, in_entry_t *inp) |
610{ |
611 tmd_notify_t nt; |
612 u_int8_t status = inp->in_status & ~QLTM_SVALID; 613 |
614 MEMZERO(&nt, sizeof (nt)); 615 nt.nt_hba = isp; 616 /* nt_str set in outer layers */ 617 nt.nt_iid = GET_IID_VAL(inp->in_iid); 618 nt.nt_tgt = inp->in_tgt; 619 nt.nt_lun = inp->in_lun; 620 IN_MAKE_TAGID(nt.nt_tagval, 0, inp); 621 nt.nt_lreserved = inp; |
622 |
623 if (status == IN_IDE_RECEIVED || status == IN_MSG_RECEIVED) { 624 switch (inp->in_msg[0]) { 625 case MSG_ABORT: 626 nt.nt_ncode = NT_ABORT_TASK_SET; 627 break; 628 case MSG_BUS_DEV_RESET: 629 nt.nt_ncode = NT_TARGET_RESET; 630 break; 631 case MSG_ABORT_TAG: 632 nt.nt_ncode = NT_ABORT_TASK; 633 break; 634 case MSG_CLEAR_QUEUE: 635 nt.nt_ncode = NT_CLEAR_TASK_SET; 636 break; 637 case MSG_REL_RECOVERY: 638 nt.nt_ncode = NT_CLEAR_ACA; 639 break; 640 case MSG_TERM_IO_PROC: 641 nt.nt_ncode = NT_ABORT_TASK; 642 break; 643 case MSG_LUN_RESET: 644 nt.nt_ncode = NT_LUN_RESET; 645 break; 646 default: 647 isp_prt(isp, ISP_LOGERR, 648 "unhandled message 0x%x", inp->in_msg[0]); 649 isp_notify_ack(isp, inp); 650 return; 651 } 652 (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &nt); |
653 } else { 654 isp_prt(isp, ISP_LOGERR, 655 "unknown immediate notify status 0x%x", inp->in_status); |
656 isp_notify_ack(isp, inp); |
657 } 658} 659 660/* 661 * Synthesize a message from the task management flags in a FCP_CMND_IU. 662 */ 663static void |
664isp_got_msg_fc(struct ispsoftc *isp, in_fcentry_t *inp) |
665{ |
666 tmd_notify_t nt; 667 static const char f1[] = "%s from iid 0x%08x%08x lun %d seq 0x%x"; |
668 static const char f2[] = |
669 "unknown %s 0x%x lun %d iid 0x%08x%08x task flags 0x%x seq 0x%x\n"; |
670 |
671 MEMZERO(&nt, sizeof (tmd_notify_t)); 672 nt.nt_hba = isp; 673 /* 674 * XXX: LOOK UP TRANSLATION IN CURRENT LPORTDB 675 */ 676 if (IS_2KLOGIN(isp)) { 677 nt.nt_iid = ((in_fcentry_e_t *)inp)->in_iid; 678 } else { 679 nt.nt_iid = inp->in_iid; /* possibly reset in outer layer */ 680 } 681 /* nt_tgt set in outer layers */ |
682 if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) { |
683 nt.nt_lun = inp->in_scclun; |
684 } else { |
685 nt.nt_lun = inp->in_lun; |
686 } |
687 IN_FC_MAKE_TAGID(nt.nt_tagval, 0, inp); 688 nt.nt_lreserved = inp; |
689 690 if (inp->in_status != IN_MSG_RECEIVED) { 691 isp_prt(isp, ISP_LOGINFO, f2, "immediate notify status", |
692 inp->in_status, nt.nt_lun, (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, |
693 inp->in_task_flags, inp->in_seqid); |
694 isp_notify_ack(isp, inp); 695 return; 696 } |
697 |
698 if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK_SET) { 699 isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET", 700 (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid); 701 nt.nt_ncode = NT_ABORT_TASK_SET; 702 } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_TASK_SET) { 703 isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET", 704 (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid); 705 nt.nt_ncode = NT_CLEAR_TASK_SET; 706 } else if (inp->in_task_flags & TASK_FLAGS_LUN_RESET) { 707 isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET", 708 (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid); 709 nt.nt_ncode = NT_LUN_RESET; 710 } else if (inp->in_task_flags & TASK_FLAGS_TARGET_RESET) { 711 isp_prt(isp, ISP_LOGINFO, f1, "TARGET RESET", 712 (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid); 713 nt.nt_ncode = NT_TARGET_RESET; 714 } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_ACA) { 715 isp_prt(isp, ISP_LOGINFO, f1, "CLEAR ACA", 716 (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, nt.nt_lun, inp->in_seqid); 717 nt.nt_ncode = NT_CLEAR_ACA; 718 } else { 719 isp_prt(isp, ISP_LOGWARN, f2, "task flag", 720 inp->in_status, nt.nt_lun, (u_int32_t) (nt.nt_iid >> 32), (u_int32_t) nt.nt_iid, 721 inp->in_task_flags, inp->in_seqid); 722 isp_notify_ack(isp, inp); 723 return; |
724 } |
725 (void) isp_async(isp, ISPASYNC_TARGET_NOTIFY, &nt); |
726} 727 |
728void |
729isp_notify_ack(struct ispsoftc *isp, void *arg) 730{ 731 char storage[QENTRY_LEN]; 732 u_int16_t nxti, optr; 733 void *outp; 734 735 if (isp_getrqentry(isp, &nxti, &optr, &outp)) { 736 isp_prt(isp, ISP_LOGWARN, 737 "Request Queue Overflow For isp_notify_ack"); 738 return; 739 } 740 741 MEMZERO(storage, QENTRY_LEN); 742 743 if (IS_FC(isp)) { 744 na_fcentry_t *na = (na_fcentry_t *) storage; 745 if (arg) { 746 in_fcentry_t *inp = arg; 747 MEMCPY(storage, arg, sizeof (isphdr_t)); |
748 if (IS_2KLOGIN(isp)) { 749 ((na_fcentry_e_t *)na)->na_iid = ((in_fcentry_e_t *)inp)->in_iid; 750 } else { 751 na->na_iid = inp->in_iid; 752 } |
753 if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) { 754 na->na_lun = inp->in_scclun; 755 } else { 756 na->na_lun = inp->in_lun; 757 } 758 na->na_task_flags = inp->in_task_flags; 759 na->na_seqid = inp->in_seqid; 760 na->na_flags = NAFC_RCOUNT; 761 na->na_status = inp->in_status; 762 if (inp->in_status == IN_RESET) { 763 na->na_flags |= NAFC_RST_CLRD; 764 } 765 } else { 766 na->na_flags = NAFC_RST_CLRD; 767 } 768 na->na_header.rqs_entry_type = RQSTYPE_NOTIFY_ACK; 769 na->na_header.rqs_entry_count = 1; |
770 if (IS_2KLOGIN(isp)) { 771 isp_put_notify_ack_fc_e(isp, (na_fcentry_e_t *) na, (na_fcentry_e_t *)outp); 772 } else { 773 isp_put_notify_ack_fc(isp, na, (na_fcentry_t *)outp); 774 } |
775 } else { 776 na_entry_t *na = (na_entry_t *) storage; 777 if (arg) { 778 in_entry_t *inp = arg; 779 MEMCPY(storage, arg, sizeof (isphdr_t)); 780 na->na_iid = inp->in_iid; 781 na->na_lun = inp->in_lun; 782 na->na_tgt = inp->in_tgt; --- 91 unchanged lines hidden (view full) --- 874 (void) isp_target_put_atio(isp, aep); 875 break; 876 } 877} 878 879static void 880isp_handle_atio2(struct ispsoftc *isp, at2_entry_t *aep) 881{ |
882 int lun, iid; |
883 884 if (FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) { 885 lun = aep->at_scclun; 886 } else { 887 lun = aep->at_lun; 888 } 889 |
890 if (IS_2KLOGIN(isp)) { 891 iid = ((at2e_entry_t *)aep)->at_iid; 892 } else { 893 iid = aep->at_iid; 894 } 895 |
896 /* 897 * The firmware status (except for the QLTM_SVALID bit) indicates 898 * why this ATIO was sent to us. 899 * 900 * If QLTM_SVALID is set, the firware has recommended Sense Data. 901 * 902 * If the DISCONNECTS DISABLED bit is set in the flags field, 903 * we're still connected on the SCSI bus - i.e. the initiator --- 43 unchanged lines hidden (view full) --- 947 /* 948 * A bus reset came along an blew away this command. Why 949 * they do this in addition the async event code stuff, 950 * I dunno. 951 * 952 * Ignore it because the async event will clear things 953 * up for us. 954 */ |
955 isp_prt(isp, ISP_LOGERR, atior, lun, iid, 0); |
956 break; 957 958 959 default: 960 isp_prt(isp, ISP_LOGERR, 961 "Unknown ATIO2 status 0x%x from initiator %d for lun %d", |
962 aep->at_status, iid, lun); |
963 (void) isp_target_put_atio(isp, aep); 964 break; 965 } 966} 967 968static void 969isp_handle_ctio(struct ispsoftc *isp, ct_entry_t *ct) 970{ --- 316 unchanged lines hidden --- |