Deleted Added
full compact
1c1
< /* $FreeBSD: head/sys/dev/isp/isp.c 63383 2000-07-18 06:46:48Z mjacob $ */
---
> /* $FreeBSD: head/sys/dev/isp/isp.c 64095 2000-08-01 06:51:05Z mjacob $ */
56a57,59
> #ifdef __svr4__
> #include "isp_solaris.h"
> #endif
67c70,107
<
---
> static char *warnlun =
> "WARNING- cannot determine Expanded LUN capability- limiting to one LUN";
> static char *portshift =
> "Target %d Loop ID 0x%x (Port 0x%x) => Loop 0x%x (Port 0x%x)";
> static char *portdup =
> "Target %d duplicates Target %d- killing off both";
> static char *retained =
> "Retaining Loop ID 0x%x for Target %d (Port 0x%x)";
> #ifdef ISP2100_FABRIC
> static char *lretained =
> "Retained login of Target %d (Loop ID 0x%x) Port 0x%x";
> static char *plogout =
> "Logging out Target %d at Loop ID 0x%x (Port 0x%x)";
> static char *plogierr =
> "Command Error in PLOGI for Port 0x%x (0x%x)";
> static char *nopdb =
> "Could not get PDB for Device @ Port 0x%x";
> static char *pdbmfail1 =
> "PDB Loop ID info for Device @ Port 0x%x does not match up (0x%x)";
> static char *pdbmfail2 =
> "PDB Port info for Device @ Port 0x%x does not match up (0x%x)";
> static char *ldumped =
> "Target %d (Loop ID 0x%x) Port 0x%x dumped after login info mismatch";
> #endif
> static char *notresp =
> "Not RESPONSE in RESPONSE Queue (type 0x%x) @ idx %d (next %d)";
> static char *xact1 =
> "HBA attempted queued transaction with disconnect not set for %d.%d.%d";
> static char *xact2 =
> "HBA attempted queued transaction to target routine %d on target %d bus %d";
> static char *xact3 =
> "HBA attempted queued cmd for %d.%d.%d when queueing disabled";
> static char *pskip =
> "SCSI phase skipped for target %d.%d.%d";
> static char *topology =
> "Loop ID %d, AL_PA 0x%x, Port ID 0x%x, Loop State 0x%x, Topology '%s'";
> static char *finmsg =
> "(%d.%d.%d): FIN dl%d resid%d STS 0x%x SKEY %c XS_ERR=0x%x";
75c115
< __P((struct ispsoftc *, ispstatusreq_t *, ISP_SCSI_XFER_T *));
---
> __P((struct ispsoftc *, ispstatusreq_t *, XS_T *));
83a124
> static char *isp2100_fw_statename __P((int));
90,91c131
< static void isp_dumpregs __P((struct ispsoftc *, const char *));
< static void isp_mboxcmd __P((struct ispsoftc *, mbreg_t *));
---
> static void isp_mboxcmd __P((struct ispsoftc *, mbreg_t *, int));
103d142
<
120a160
>
125,128c165
< */
< isp->isp_dblev = DFLT_DBLEVEL;
<
< /*
---
> *
130c167
< * for SCSI adapters and other settings for the 2100.
---
> * for SCSI adapters and do other settings for the 2100.
143c180,182
< * Just in case it was paused...
---
> * First see whether or not we're sitting in the ISP PROM.
> * If we've just been reset, we'll have the string "ISP "
> * spread through outgoing mailbox registers 1-3.
145,155c184,200
< ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
< mbs.param[0] = MBOX_ABOUT_FIRMWARE;
< isp_mboxcmd(isp, &mbs);
< /*
< * If this fails, it probably means we're running
< * an old prom, if anything at all...
< */
< if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
< isp->isp_romfw_rev[0] = mbs.param[1];
< isp->isp_romfw_rev[1] = mbs.param[2];
< isp->isp_romfw_rev[2] = mbs.param[3];
---
> if (ISP_READ(isp, OUTMAILBOX1) != 0x4953 ||
> ISP_READ(isp, OUTMAILBOX2) != 0x5020 ||
> ISP_READ(isp, OUTMAILBOX3) != 0x2020) {
> /*
> * Just in case it was paused...
> */
> ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
> mbs.param[0] = MBOX_ABOUT_FIRMWARE;
> isp_mboxcmd(isp, &mbs, MBLOGNONE);
> /*
> * This *shouldn't* fail.....
> */
> if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
> isp->isp_romfw_rev[0] = mbs.param[1];
> isp->isp_romfw_rev[1] = mbs.param[2];
> isp->isp_romfw_rev[2] = mbs.param[3];
> }
190c235
< static char *m = "%s: bus %d is in %s Mode\n";
---
> static char *m = "bus %d is in %s Mode";
209c254
< CFGPRINTF(m, isp->isp_name, 0, "LVD");
---
> isp_prt(isp, ISP_LOGCONFIG, m, 0, "LVD");
213c258
< CFGPRINTF(m, isp->isp_name, 0, "Differential");
---
> isp_prt(isp, ISP_LOGCONFIG, m, 0, "Differential");
217c262
< CFGPRINTF(m, isp->isp_name, 0, "Single-Ended");
---
> isp_prt(isp, ISP_LOGCONFIG, m, 0, "Single-Ended");
220,221c265,266
< CFGPRINTF("%s: unknown mode on bus %d (0x%x)\n",
< isp->isp_name, 0, l);
---
> isp_prt(isp, ISP_LOGERR,
> "unknown mode on bus %d (0x%x)", 0, l);
232c277
< CFGPRINTF(m, isp->isp_name, 1, "LVD");
---
> isp_prt(isp, ISP_LOGCONFIG, m, 1, "LVD");
236c281,282
< CFGPRINTF(m, isp->isp_name, 1, "Differential");
---
> isp_prt(isp, ISP_LOGCONFIG,
> m, 1, "Differential");
240c286,287
< CFGPRINTF(m, isp->isp_name, 1, "Single-Ended");
---
> isp_prt(isp, ISP_LOGCONFIG,
> m, 1, "Single-Ended");
243,244c290,291
< CFGPRINTF("%s: unknown mode on bus %d (0x%x)\n",
< isp->isp_name, 1, l);
---
> isp_prt(isp, ISP_LOGERR,
> "unknown mode on bus %d (0x%x)", 1, l);
253,254c300
< PRINTF("%s: unknown chip rev. 0x%x- assuming a 1020\n",
< isp->isp_name, i);
---
> isp_prt(isp, ISP_LOGALL, "Unknown Chip Type 0x%x", i);
297c343
< CFGPRINTF("%s: Differential Mode\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGCONFIG, "Differential Mode");
309c355
< CFGPRINTF("%s: Ultra Mode Capable\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGCONFIG, "Ultra Mode Capable");
352c398
< SYS_DELAY(100);
---
> USEC_DELAY(100);
354,361d399
< #if 0
< PRINTF("%s: mbox0-5: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
< isp->isp_name, ISP_READ(isp, OUTMAILBOX0),
< ISP_READ(isp, OUTMAILBOX1), ISP_READ(isp, OUTMAILBOX2),
< ISP_READ(isp, OUTMAILBOX3), ISP_READ(isp, OUTMAILBOX4),
< ISP_READ(isp, OUTMAILBOX5));
< #endif
<
376c414
< SYS_DELAY(100);
---
> USEC_DELAY(100);
401c439
< SYS_DELAY(100);
---
> USEC_DELAY(100);
403c441
< isp_dumpregs(isp, "chip reset timed out");
---
> ISP_DUMPREGS(isp, "chip reset timed out");
423c461
< SYS_DELAY(100);
---
> USEC_DELAY(100);
475c513
< SYS_DELAY(100);
---
> USEC_DELAY(100);
477,478c515,516
< PRINTF("%s: MBOX_BUSY never cleared on reset\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR,
> "MBOX_BUSY never cleared on reset");
493c531
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
495d532
< isp_dumpregs(isp, "NOP test failed");
506c543
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
508,509d544
< isp_dumpregs(isp,
< "Mailbox Register test didn't complete");
515c550,553
< isp_dumpregs(isp, "Register Test Failed");
---
> isp_prt(isp, ISP_LOGERR,
> "Register Test Failed (0x%x 0x%x 0x%x 0x%x 0x%x)",
> mbs.param[1], mbs.param[2], mbs.param[3],
> mbs.param[4], mbs.param[5]);
536,538c574
< u_int16_t fwlen = isp->isp_mdvec->dv_fwlen;
< if (fwlen == 0)
< fwlen = isp->isp_mdvec->dv_ispfw[3]; /* usually here */
---
> u_int16_t fwlen = isp->isp_mdvec->dv_ispfw[3];
541c577
< mbs.param[1] = isp->isp_mdvec->dv_codeorg + i;
---
> mbs.param[1] = ISP_CODE_ORG + i;
543c579
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGNONE);
545,546c581,582
< PRINTF("%s: F/W download failed at word %d\n",
< isp->isp_name, i);
---
> isp_prt(isp, ISP_LOGERR,
> "F/W download failed at word %d", i);
556,557c592,593
< mbs.param[1] = isp->isp_mdvec->dv_codeorg;
< isp_mboxcmd(isp, &mbs);
---
> mbs.param[1] = ISP_CODE_ORG;
> isp_mboxcmd(isp, &mbs, MBLOGNONE);
559c595
< isp_dumpregs(isp, "ram checksum failure");
---
> isp_prt(isp, ISP_LOGERR, "Ram Checksum Failure");
563c599
< IDPRINTF(3, ("%s: skipping f/w download\n", isp->isp_name));
---
> isp_prt(isp, ISP_LOGDEBUG2, "skipping f/w download");
574,578c610,611
< if (isp->isp_mdvec->dv_codeorg)
< mbs.param[1] = isp->isp_mdvec->dv_codeorg;
< else
< mbs.param[1] = 0x1000;
< isp_mboxcmd(isp, &mbs);
---
> mbs.param[1] = ISP_CODE_ORG;
> isp_mboxcmd(isp, &mbs, MBLOGNONE);
580c613
< SYS_DELAY(500);
---
> USEC_DELAY(500);
589,594c622,623
< isp_mboxcmd(isp, &mbs);
< if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
< PRINTF("failed to set clockrate (0x%x)\n",
< mbs.param[0]);
< /* but continue */
< }
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
> /* we will try not to care if this fails */
596a626
>
598c628
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
600d629
< PRINTF("could not get f/w started (0x%x)\n", mbs.param[0]);
603,605c632,635
< CFGPRINTF("%s: Board Revision %s, %s F/W Revision %d.%d.%d\n",
< isp->isp_name, revname, dodnld? "loaded" : "resident",
< mbs.param[1], mbs.param[2], mbs.param[3]);
---
> isp_prt(isp, ISP_LOGCONFIG,
> "Board Revision %s, %s F/W Revision %d.%d.%d", revname,
> dodnld? "loaded" : "resident", mbs.param[1], mbs.param[2],
> mbs.param[3]);
608c638,639
< CFGPRINTF("%s: in 64-Bit PCI slot\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGCONFIG,
> "Installed in 64-Bit PCI slot");
617c648
< CFGPRINTF("%s: Last F/W revision was %d.%d.%d\n", isp->isp_name,
---
> isp_prt(isp, ISP_LOGCONFIG, "Last F/W revision was %d.%d.%d",
623c654
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
625d655
< PRINTF("%s: could not GET FIRMWARE STATUS\n", isp->isp_name);
629,630c659,660
< CFGPRINTF("%s: %d max I/O commands supported\n",
< isp->isp_name, mbs.param[2]);
---
> isp_prt(isp, ISP_LOGINFO,
> "%d max I/O commands supported", mbs.param[2]);
637c667
< PRINTF("%s: can't setup dma mailboxes\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "Cannot setup DMA");
674,676c704
< PRINTF("%s: WARNING- cannot determine Expanded "
< "LUN capability- limiting to one LUN\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGALL, warnlun);
700d727
<
740c767
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
742,743d768
< PRINTF("%s: failed to set retry count and retry delay\n",
< isp->isp_name);
753c778
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
755,756d779
< PRINTF("%s: failed to set asynchronous data setup time\n",
< isp->isp_name);
771c794
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGNONE);
773,774c796,797
< PRINTF("%s: failed to set active negation state "
< "(%d,%d),(%d,%d)\n", isp->isp_name,
---
> isp_prt(isp, ISP_LOGERR,
> "failed to set active negation state (%d,%d), (%d,%d)",
790c813
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
792,794c815,816
< PRINTF("%s: failed to set tag age limit (%d,%d)\n",
< isp->isp_name, sdp_chan0->isp_tag_aging,
< sdp_chan1->isp_tag_aging);
---
> isp_prt(isp, ISP_LOGERR, "failed to set tag age limit (%d,%d)",
> sdp_chan0->isp_tag_aging, sdp_chan1->isp_tag_aging);
804c826
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
806d827
< PRINTF("%s: failed to set selection timeout\n", isp->isp_name);
820c841
< mbs.param[1] = RESULT_QUEUE_LEN;
---
> mbs.param[1] = RESULT_QUEUE_LEN(isp);
825c846
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
827d847
< PRINTF("%s: set of response queue failed\n", isp->isp_name);
833c853
< mbs.param[1] = RQUEST_QUEUE_LEN;
---
> mbs.param[1] = RQUEST_QUEUE_LEN(isp);
838c858
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
840d859
< PRINTF("%s: set of request queue failed\n", isp->isp_name);
862,868c881,884
< isp_mboxcmd(isp, &mbs);
< if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
< PRINTF("%s: cannot enable FW features (0x%x)\n",
< isp->isp_name, sfeat);
< } else {
< CFGPRINTF("%s: enabled FW features (0x%x)\n",
< isp->isp_name, sfeat);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
> if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
> isp_prt(isp, ISP_LOGINFO,
> "Enabled FW features (0x%x)", sfeat);
895c911
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
897,898d912
< PRINTF("%s: cannot set initiator id on bus %d to %d\n",
< isp->isp_name, channel, sdp->isp_initiator_id);
910,911d923
< IDPRINTF(2, ("%s: skipping target %d bus %d settings\n",
< isp->isp_name, tgt, channel));
942c954
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
951c963
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
953,954d964
< PRINTF("%s: failed even to set defaults for "
< "target %d\n", isp->isp_name, tgt);
967c977
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
979,980c989,991
< IDPRINTF(3, ("%s: set flags 0x%x got 0x%x back for target %d\n",
< isp->isp_name, sdf, mbs.param[2], tgt));
---
> isp_prt(isp, ISP_LOGTDEBUG0,
> "set flags 0x%x got 0x%x back for target %d",
> sdf, mbs.param[2], tgt);
996c1007
< for (lun = 0; lun < isp->isp_maxluns; lun++) {
---
> for (lun = 0; lun < (int) isp->isp_maxluns; lun++) {
1001c1012
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
1003,1005d1013
< PRINTF("%s: failed to set device queue "
< "parameters for target %d, lun %d\n",
< isp->isp_name, tgt, lun);
1028,1036d1035
< /*
< * For systems that don't have BIOS methods for which
< * we can easily change the NVRAM based loopid, we'll
< * override that here. Note that when we initialize
< * the firmware we may get back a different loopid than
< * we asked for anyway. XXX This is probably not the
< * best way to figure this out XXX
< */
< #ifndef __i386__
1038,1041d1036
< #else
< loopid = fcp->isp_loopid;
< #endif
<
1083,1084c1078,1080
< PRINTF("%s: bad frame length (%d) from NVRAM- using %d\n",
< isp->isp_name, fcp->isp_maxfrmlen, ICB_DFLT_FRMLEN);
---
> isp_prt(isp, ISP_LOGERR,
> "bad frame length (%d) from NVRAM- using %d",
> fcp->isp_maxfrmlen, ICB_DFLT_FRMLEN);
1089,1090c1085,1086
< PRINTF("%s: bad maximum allocation (%d)- using 16\n",
< isp->isp_name, fcp->isp_maxalloc);
---
> isp_prt(isp, ISP_LOGERR,
> "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc);
1095,1096c1091,1093
< PRINTF("%s: bad execution throttle of %d- using 16\n",
< isp->isp_name, fcp->isp_execthrottle);
---
> isp_prt(isp, ISP_LOGERR,
> "bad execution throttle of %d- using 16",
> fcp->isp_execthrottle);
1122,1123c1119,1120
< icbp->icb_rqstqlen = RQUEST_QUEUE_LEN;
< icbp->icb_rsltqlen = RESULT_QUEUE_LEN;
---
> icbp->icb_rqstqlen = RQUEST_QUEUE_LEN(isp);
> icbp->icb_rsltqlen = RESULT_QUEUE_LEN(isp);
1137,1157c1134,1144
< MemoryBarrier();
< for (;;) {
< mbs.param[0] = MBOX_INIT_FIRMWARE;
< mbs.param[1] = 0;
< mbs.param[2] = DMA_MSW(fcp->isp_scdma);
< mbs.param[3] = DMA_LSW(fcp->isp_scdma);
< mbs.param[4] = 0;
< mbs.param[5] = 0;
< mbs.param[6] = 0;
< mbs.param[7] = 0;
< isp_mboxcmd(isp, &mbs);
< if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
< PRINTF("%s: INIT FIRMWARE failed (code 0x%x)\n",
< isp->isp_name, mbs.param[0]);
< if (mbs.param[0] & 0x8000) {
< SYS_DELAY(1000);
< continue;
< }
< return;
< }
< break;
---
> mbs.param[0] = MBOX_INIT_FIRMWARE;
> mbs.param[1] = 0;
> mbs.param[2] = DMA_MSW(fcp->isp_scdma);
> mbs.param[3] = DMA_LSW(fcp->isp_scdma);
> mbs.param[4] = 0;
> mbs.param[5] = 0;
> mbs.param[6] = 0;
> mbs.param[7] = 0;
> isp_mboxcmd(isp, &mbs, MBLOGALL);
> if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
> return;
1159d1145
<
1210,1213c1196,1197
< isp_mboxcmd(isp, &mbs);
< switch (mbs.param[0]) {
< case MBOX_COMMAND_COMPLETE:
< MemoryBarrier();
---
> isp_mboxcmd(isp, &mbs, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR);
> if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
1215,1227c1199
< break;
< case MBOX_HOST_INTERFACE_ERROR:
< PRINTF("%s: DMA error getting port database\n", isp->isp_name);
< return (-1);
< case MBOX_COMMAND_PARAM_ERROR:
< /* Not Logged In */
< IDPRINTF(3, ("%s: Param Error on Get Port Database for id %d\n",
< isp->isp_name, id));
< return (-1);
< default:
< PRINTF("%s: error 0x%x getting port database for ID %d\n",
< isp->isp_name, mbs.param[0], id);
< return (-1);
---
> return (0);
1229c1201
< return (0);
---
> return (-1);
1245c1217
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL & ~MBOX_COMMAND_PARAM_ERROR);
1265c1237
< isp_fclink_test(isp, waitdelay)
---
> isp_fclink_test(isp, usdelay)
1267c1239
< int waitdelay;
---
> int usdelay;
1285a1258,1261
> * XXX: Here is where we would start a 'loop dead' timeout
> */
>
> /*
1289c1265,1271
< for (count = 0; count < waitdelay; count += 100) {
---
> count = 0;
> while (count < usdelay) {
> u_int64_t enano;
> u_int32_t wrk;
> NANOTIME_T hra, hrb;
>
> GET_NANOTIME(&hra);
1292,1293c1274,1275
< PRINTF("%s: Firmware State %s -> %s\n",
< isp->isp_name, isp2100_fw_statename((int)lwfs),
---
> isp_prt(isp, ISP_LOGINFO, "Firmware State <%s->%s>",
> isp2100_fw_statename((int)lwfs),
1300c1282,1319
< SYS_DELAY(100); /* wait 100 microseconds */
---
> GET_NANOTIME(&hrb);
>
> /*
> * Get the elapsed time in nanoseconds.
> * Always guaranteed to be non-zero.
> */
> enano = NANOTIME_SUB(&hrb, &hra);
>
> /*
> * If the elapsed time is less than 1 millisecond,
> * delay a period of time up to that millisecond of
> * waiting.
> */
> isp_prt(isp, ISP_LOGDEBUG3, "usec%d: 0x%lx->0x%lx enano %u",
> count, GET_NANOSEC(&hra), GET_NANOSEC(&hrb), enano);
>
> /*
> * This peculiar code is an attempt to try and avoid
> * invoking u_int64_t math support functions for some
> * platforms where linkage is a problem.
> */
> if (enano < (1000 * 1000)) {
> count += 1000;
> enano = (1000 * 1000) - enano;
> while (enano > (u_int64_t) 4000000000U) {
> USEC_DELAY(4000000);
> enano -= (u_int64_t) 4000000000U;
> }
> wrk = enano;
> USEC_DELAY(wrk/1000);
> } else {
> while (enano > (u_int64_t) 4000000000U) {
> count += 4000000;
> enano -= (u_int64_t) 4000000000U;
> }
> wrk = enano;
> count += (wrk / 1000);
> }
1314c1333
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
1316d1334
< PRINTF("%s: GET LOOP ID failed\n", isp->isp_name);
1384,1387c1402,1403
< CFGPRINTF("%s: Loop ID %d, AL_PA 0x%x, Port ID 0x%x Loop State "
< "0x%x topology '%s'\n", isp->isp_name, fcp->isp_loopid,
< fcp->isp_alpa, fcp->isp_portid, fcp->isp_loopstate,
< toponames[fcp->isp_topo]);
---
> isp_prt(isp, ISP_LOGINFO, topology, fcp->isp_loopid, fcp->isp_alpa,
> fcp->isp_portid, fcp->isp_loopstate, toponames[fcp->isp_topo]);
1392,1394c1408,1423
< /*
< * Compare two local port db entities and return 1 if they're the same, else 0.
< */
---
> static char *
> isp2100_fw_statename(state)
> int state;
> {
> switch(state) {
> case FW_CONFIG_WAIT: return "Config Wait";
> case FW_WAIT_AL_PA: return "Waiting for AL_PA";
> case FW_WAIT_LOGIN: return "Wait Login";
> case FW_READY: return "Ready";
> case FW_LOSS_OF_SYNC: return "Loss Of Sync";
> case FW_ERROR: return "Error";
> case FW_REINIT: return "Re-Init";
> case FW_NON_PART: return "Nonparticipating";
> default: return "?????";
> }
> }
1505,1506c1534,1535
< PRINTF("%s: giving up on synchronizing the port "
< "database\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGWARN,
> "giving up on synchronizing the port database");
1610,1612c1639,1640
< PRINTF("%s: Target ID %d Loop 0x%x (Port 0x%x) "
< "=> Loop 0x%x (Port 0x%x) \n",
< isp->isp_name, i, fcp->portdb[i].loopid,
---
> isp_prt(isp, ISP_LOGINFO, portshift, i,
> fcp->portdb[i].loopid,
1630,1632c1658
< PRINTF("%s: Target ID %d Duplicates Target ID "
< "%d- killing off both\n",
< isp->isp_name, j, i);
---
> isp_prt(isp, ISP_LOGWARN, portdup, j, i);
1665c1691
< PRINTF("%s: remap overflow?\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGWARN, "Remap Overflow");
1761,1764c1787,1789
< IDPRINTF(1, ("%s: retained login of Target %d "
< "(Loop 0x%x) Port ID 0x%x\n",
< isp->isp_name, (int) (lp - fcp->portdb),
< (int) lp->loopid, lp->portid));
---
> isp_prt(isp, ISP_LOGINFO, lretained,
> (int) (lp - fcp->portdb),
> (int) lp->loopid, lp->portid);
1777c1802
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGNONE);
1779,1781c1804,1805
< IDPRINTF(1, ("%s: Logging out target %d at Loop ID %d "
< "(port id 0x%x)\n", isp->isp_name,
< (int) (lp - fcp->portdb), lp->loopid, lp->portid));
---
> isp_prt(isp, ISP_LOGINFO, plogout,
> (int) (lp - fcp->portdb), lp->loopid, lp->portid);
1798c1822,1823
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL & ~(MBOX_LOOP_ID_USED |
> MBOX_PORT_ID_USED | MBOX_COMMAND_ERROR));
1814,1818c1839,1841
< IDPRINTF(1, ("%s: Retaining loopid 0x%x"
< " for Target %d (port id 0x%x)\n",
< isp->isp_name, loopid,
< (int) (lp - fcp->portdb),
< lp->portid));
---
> isp_prt(isp, ISP_LOGINFO, retained,
> loopid, (int) (lp - fcp->portdb),
> lp->portid);
1829,1831c1852,1853
< PRINTF("%s: command error in PLOGI for port "
< " 0x%x (0x%x)\n", isp->isp_name, portid,
< mbs.param[1]);
---
> isp_prt(isp, ISP_LOGINFO, plogierr,
> portid, mbs.param[1]);
1853,1854c1875
< PRINTF("%s: could not get PDB for device@port 0x%x\n",
< isp->isp_name, lp->portid);
---
> isp_prt(isp, ISP_LOGWARN, nopdb, lp->portid);
1859,1861c1880,1881
< PRINTF("%s: PDB loopid info for device@port 0x%x does "
< "not match up (0x%x)\n", isp->isp_name, lp->portid,
< pdb.pdb_loopid);
---
> isp_prt(isp, ISP_LOGWARN, pdbmfail1,
> lp->portid, pdb.pdb_loopid);
1866,1868c1886,1887
< PRINTF("%s: PDB port info for device@port 0x%x does "
< "not match up (0x%x)\n", isp->isp_name, lp->portid,
< BITS2WORD(pdb.pdb_portid_bits));
---
> isp_prt(isp, ISP_LOGWARN, pdbmfail2,
> lp->portid, BITS2WORD(pdb.pdb_portid_bits));
1903,1904c1922,1923
< PRINTF("%s: Target %d (Loop 0x%x) Port ID 0x%x dumped after "
< "login\n", isp->isp_name, loopid, lp->loopid, lp->portid);
---
> isp_prt(isp, ISP_LOGINFO,
> ldumped, loopid, lp->loopid, lp->portid);
1909c1928
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGNONE);
1915c1934
< * in ispscsicmd.
---
> * in isp_start.
1955,1956c1974
< MemoryBarrier();
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
1958,1959d1975
< IDPRINTF(1, ("%s: SNS failed (0x%x)\n", isp->isp_name,
< mbs.param[0]));
1986,1988c2002,2004
< int32_t
< ispscsicmd(xs)
< ISP_SCSI_XFER_T *xs;
---
> int
> isp_start(xs)
> XS_T *xs;
2005c2021
< PRINTF("%s: adapter not ready\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "Adapter not at RUNSTATE");
2018,2019c2034,2036
< PRINTF("%s: unsupported cdb length (%d, CDB[0]=0x%x)\n",
< isp->isp_name, XS_CDBLEN(xs), XS_CDBP(xs)[0] & 0xff);
---
> isp_prt(isp, ISP_LOGERR,
> "unsupported cdb length (%d, CDB[0]=0x%x)",
> XS_CDBLEN(xs), XS_CDBP(xs)[0] & 0xff);
2069c2086,2089
< if (isp_fclink_test(isp, FC_FW_READY_DELAY)) {
---
> /*
> * Give ourselves at most a 250ms delay.
> */
> if (isp_fclink_test(isp, 250000)) {
2109a2130,2134
> * XXX: Here's were we would cancel any loop_dead flag
> * XXX: also cancel in dead_loop timeout that's running
> */
>
> /*
2118,2119c2143,2144
< IDPRINTF(3, ("%s: target %d is not a target\n",
< isp->isp_name, target));
---
> isp_prt(isp, ISP_LOGDEBUG2,
> "Target %d does not have target service", target);
2138c2163
< IDPRINTF(2, ("%s: Request Queue Overflow\n", isp->isp_name));
---
> isp_prt(isp, ISP_LOGDEBUG0, "Request Queue Overflow");
2163d2187
< MemoryBarrier();
2167,2168c2191,2192
< IDPRINTF(2, ("%s: Request Queue Overflow+\n",
< isp->isp_name));
---
> isp_prt(isp, ISP_LOGDEBUG0,
> "Request Queue Overflow+");
2198,2199c2222,2223
< if (XS_CANTAG(xs)) {
< t2reqp->req_flags = XS_KINDOF_TAG(xs);
---
> if (XS_TAG_P(xs)) {
> t2reqp->req_flags = XS_TAG_TYPE(xs);
2209,2210c2233,2234
< XS_CANTAG(xs)) {
< reqp->req_flags = XS_KINDOF_TAG(xs);
---
> XS_TAG_P(xs)) {
> reqp->req_flags = XS_TAG_TYPE(xs);
2237c2261
< IDPRINTF(2, ("%s: out of xflist pointers\n", isp->isp_name));
---
> isp_prt(isp, ISP_LOGDEBUG1, "out of xflist pointers");
2255,2258c2279,2281
< IDPRINTF(5, ("%s(%d.%d.%d): START cmd 0x%x datalen %d\n",
< isp->isp_name, XS_CHANNEL(xs), target, XS_LUN(xs),
< reqp->req_cdb[0], XS_XFRLEN(xs)));
< MemoryBarrier();
---
> isp_prt(isp, ISP_LOGDEBUG2,
> "START cmd for %d.%d.%d cmd 0x%x datalen %d",
> XS_CHANNEL(xs), target, XS_LUN(xs), XS_CDBP(xs)[0], XS_XFRLEN(xs));
2279c2302
< ISP_SCSI_XFER_T *xs;
---
> XS_T *xs;
2286,2287c2309
< PRINTF("%s: isp_control unknown control op %x\n",
< isp->isp_name, ctl);
---
> isp_prt(isp, ISP_LOGERR, "Unknown Control Opcode 0x%x", ctl);
2309c2331
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
2311d2332
< isp_dumpregs(isp, "isp_control SCSI bus reset failed");
2314,2315c2335,2336
< CFGPRINTF("%s: driver initiated bus reset of bus %d\n",
< isp->isp_name, bus);
---
> isp_prt(isp, ISP_LOGINFO,
> "driver initiated bus reset of bus %d", bus);
2324c2345
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
2326,2327d2346
< PRINTF("%s: isp_control MBOX_RESET_DEV failure (code "
< "%x)\n", isp->isp_name, mbs.param[0]);
2330,2331c2349,2350
< PRINTF("%s: Target %d on Bus %d Reset Succeeded\n",
< isp->isp_name, tgt, bus);
---
> isp_prt(isp, ISP_LOGINFO,
> "Target %d on Bus %d Reset Succeeded", tgt, bus);
2336c2355
< xs = (ISP_SCSI_XFER_T *) arg;
---
> xs = (XS_T *) arg;
2340,2341c2359,2360
< PRINTF("%s: isp_control- cannot find command to abort "
< "in active list\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGWARN,
> "cannot find handle for command to abort");
2361,2373c2380,2382
< isp_mboxcmd(isp, &mbs);
< switch (mbs.param[0]) {
< case MBOX_COMMAND_COMPLETE:
< IDPRINTF(1,
< ("%s: command (handle 0x%x) for %d.%d.%d aborted\n",
< isp->isp_name, handle, bus, tgt, XS_LUN(xs)));
< /* FALLTHROUGH */
< case MBOX_COMMAND_ERROR:
< break;
< default:
< PRINTF("%s: command (handle 0x%x) abort failed (%x)\n",
< isp->isp_name, handle, mbs.param[0]);
< break;
---
> isp_mboxcmd(isp, &mbs, MBLOGALL & ~MBOX_COMMAND_ERROR);
> if (mbs.param[0] == MBOX_COMMAND_COMPLETE) {
> return (0);
2375c2384
< return (0);
---
> break;
2383c2392,2393
< return (isp_fclink_test(isp, FC_FW_READY_DELAY));
---
> int usdelay = (arg)? *((int *) arg) : 250000;
> return (isp_fclink_test(isp, usdelay));
2399c2409
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
2401,2403d2410
< PRINTF("%s: cannot %sable target mode (0x%x)\n",
< isp->isp_name, ena? "en" : "dis",
< mbs.param[0]);
2419a2427,2432
> /*
> * Limit our stack depth by sticking with the max likely number
> * of completions on a request queue at any one time.
> */
> #define MAX_REQUESTQ_COMPLETIONS 32
>
2424d2436
< ISP_SCSI_XFER_T *complist[RESULT_QUEUE_LEN], *xs;
2425a2438
> XS_T *complist[MAX_REQUESTQ_COMPLETIONS], *xs;
2436,2437c2449,2450
< PRINTF("%s: isr unsteady (%x, %x)\n",
< isp->isp_name, isr, junk);
---
> isp_prt(isp, ISP_LOGWARN,
> "isr unsteady (%x, %x)", isr, junk);
2445,2446c2458,2459
< PRINTF("%s: sema unsteady (%x, %x)\n",
< isp->isp_name, sema, junk);
---
> isp_prt(isp, ISP_LOGWARN,
> "sema unsteady (%x, %x)", sema, junk);
2452c2465
< IDPRINTF(5, ("%s: isp_intr isr %x sem %x\n", isp->isp_name, isr, sema));
---
> isp_prt(isp, ISP_LOGDEBUG3, "isp_intr isr %x sem %x", isr, sema);
2469,2470c2482,2483
< PRINTF("%s: mailbox0 unsteady (%x, %x)\n",
< isp->isp_name, mbox, junk);
---
> isp_prt(isp, ISP_LOGWARN,
> "mailbox0 unsteady (%x, %x)", mbox, junk);
2491,2492c2504,2506
< PRINTF("%s: Command Mbox 0x%x\n",
< isp->isp_name, mbox);
---
> isp_prt(isp, ISP_LOGWARN,
> "Mbox Command Async (0x%x) with no waiters",
> mbox);
2496,2497c2510
< IDPRINTF(4, ("%s: Async Mbox 0x%x\n",
< isp->isp_name, mbox));
---
> isp_prt(isp, ISP_LOGDEBUG2, "Async Mbox 0x%x", mbox);
2513,2514c2526,2527
< PRINTF("%s: interrupt (isr=%x, sema=%x) when not ready\n",
< isp->isp_name, isr, sema);
---
> isp_prt(isp, ISP_LOGWARN,
> "interrupt (isr=%x, sema=%x) when not ready", isr, sema);
2535,2536c2548,2549
< PRINTF("%s: mailbox5 unsteady (%x, %x)\n",
< isp->isp_name, iptr, junk);
---
> isp_prt(isp, ISP_LOGWARN,
> "mailbox5 unsteady (%x, %x)", iptr, junk);
2558,2559c2571,2573
< IDPRINTF(2, ("%s: null intr- isr %x (%x) iptr %x optr %x\n",
< isp->isp_name, isr, junk, iptr, optr));
---
> isp_prt(isp, ISP_LOGDEBUG2,
> "bogus intr- isr %x (%x) iptr %x optr %x",
> isr, junk, iptr, optr);
2569c2583
< optr = ISP_NXT_QENTRY(optr, RESULT_QUEUE_LEN);
---
> optr = ISP_NXT_QENTRY(optr, RESULT_QUEUE_LEN(isp));
2571d2584
< MemoryBarrier();
2575c2588
< * per-platform thing.
---
> * per-platform thing. Also includes any memory barriers.
2577c2590
< ISP_UNSWIZZLE_RESPONSE(isp, sp);
---
> ISP_UNSWIZZLE_RESPONSE(isp, sp, oop);
2588,2590c2601
< PRINTF("%s: not RESPONSE in RESPONSE Queue "
< "(type 0x%x) @ idx %d (next %d)\n",
< isp->isp_name,
---
> isp_prt(isp, ISP_LOGERR, notresp,
2601,2602c2612,2613
< IDPRINTF(4, ("%s: continuation segment\n",
< isp->isp_name));
---
> isp_prt(isp, ISP_LOGWARN,
> "continuation segment");
2607,2608c2618,2619
< IDPRINTF(2, ("%s: internal queues full\n",
< isp->isp_name));
---
> isp_prt(isp, ISP_LOGDEBUG1,
> "internal queues full");
2614c2625
< PRINTF("%s: bad header\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "bad header flag");
2618,2619c2629
< PRINTF("%s: bad request packet\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "bad request packet");
2623,2624c2633,2635
< PRINTF("%s: unknown flags in response (0x%x)\n",
< isp->isp_name, sp->req_header.rqs_flags);
---
> isp_prt(isp, ISP_LOGERR,
> "unknown flags (0x%x) in response",
> sp->req_header.rqs_flags);
2630,2631c2641,2642
< PRINTF("%s: bad request handle %d\n", isp->isp_name,
< sp->req_handle);
---
> isp_prt(isp, ISP_LOGERR,
> "bad request handle %d", sp->req_handle);
2637,2638c2648,2650
< PRINTF("%s: NULL xs in xflist (handle 0x%x)\n",
< isp->isp_name, sp->req_handle);
---
> isp_prt(isp, ISP_LOGERR,
> "cannot find handle 0x%x in xflist",
> sp->req_handle);
2649c2661
< XS_STS(xs) = sp->req_scsi_status & 0xff;
---
> *XS_STSP(xs) = sp->req_scsi_status & 0xff;
2652,2654c2664
< MEMCPY(XS_SNSP(xs), sp->req_sense_data,
< XS_SNSLEN(xs));
< XS_SNS_IS_VALID(xs);
---
> XS_SAVE_SENSE(xs, sp);
2669,2671c2679,2680
< int amt = min(XS_SNSLEN(xs), sp->req_sense_len);
< MEMCPY(XS_SNSP(xs), sp->req_sense_data, amt);
< XS_SNS_IS_VALID(xs);
---
> XS_SAVE_SENSE(xs, sp);
> /* force that we 'got' sense */
2673,2676d2681
< } else if (XS_STS(xs) == SCSI_CHECK) {
< IDPRINTF(2,
< ("%s: check condition with no sense data\n",
< isp->isp_name));
2679,2681d2683
< if (XS_NOERR(xs) && XS_STS(xs) == SCSI_BUSY) {
< XS_SETERR(xs, HBA_TGTBSY);
< }
2684,2689c2686,2690
< if (XS_NOERR(xs)) {
< if (sp->req_completion_status != RQCS_COMPLETE) {
< isp_parse_status(isp, sp, xs);
< } else {
< XS_SETERR(xs, HBA_NOERROR);
< }
---
> XS_SET_STATE_STAT(isp, xs, sp);
> isp_parse_status(isp, sp, xs);
> if ((XS_NOERR(xs) || XS_ERR(xs) == HBA_NOERROR) &&
> (*XS_STSP(xs) == SCSI_BUSY)) {
> XS_SETERR(xs, HBA_TGTBSY);
2696c2697
< XS_STS(xs) = SCSI_QFULL;
---
> *XS_STSP(xs) = SCSI_QFULL;
2702,2703c2703,2705
< PRINTF("%s: unhandled respose queue type 0x%x\n",
< isp->isp_name, sp->req_header.rqs_entry_type);
---
> isp_prt(isp, ISP_LOGWARN,
> "unhandled respose queue type 0x%x",
> sp->req_header.rqs_entry_type);
2710c2712
< } else if (sp->req_scsi_status & RQCS_RU) {
---
> } else if (sp->req_scsi_status & RQCS_RV) {
2712,2713c2714,2715
< IDPRINTF(4, ("%s: cnt %d rsd %d\n", isp->isp_name,
< XS_XFRLEN(xs), sp->req_resid));
---
> isp_prt(isp, ISP_LOGDEBUG2, "cnt %d rsd %d",
> XS_XFRLEN(xs), sp->req_resid);
2718,2722c2720,2722
< if ((isp->isp_dblev >= 5) ||
< (isp->isp_dblev > 2 && !XS_NOERR(xs))) {
< PRINTF("%s(%d.%d): FIN dl%d resid%d STS %x",
< isp->isp_name, XS_TGT(xs), XS_LUN(xs),
< XS_XFRLEN(xs), XS_RESID(xs), XS_STS(xs));
---
> if (((isp->isp_dblev & (ISP_LOGDEBUG2|ISP_LOGDEBUG3))) ||
> ((isp->isp_dblev & ISP_LOGDEBUG1) && !XS_NOERR(xs))) {
> char skey;
2724,2727c2724,2732
< PRINTF(" Skey: %x", XS_SNSKEY(xs));
< if (!(XS_IS_SNS_VALID(xs))) {
< PRINTF(" BUT NOT SET");
< }
---
> skey = XS_SNSKEY(xs) & 0xf;
> if (skey < 10)
> skey += '0';
> else
> skey += 'a';
> } else if (*XS_STSP(xs) == SCSI_CHECK) {
> skey = '?';
> } else {
> skey = '.';
2729c2734,2736
< PRINTF(" XS_ERR=0x%x\n", (unsigned int) XS_ERR(xs));
---
> isp_prt(isp, ISP_LOGALL, finmsg, XS_CHANNEL(xs),
> XS_TGT(xs), XS_LUN(xs), XS_XFRLEN(xs), XS_RESID(xs),
> *XS_STSP(xs), skey, XS_ERR(xs));
2734a2742,2744
> if (ndone == MAX_REQUESTQ_COMPLETIONS) {
> break;
> }
2751c2761
< XS_CMD_DONE(xs);
---
> isp_done(xs);
2787,2789c2797,2799
< PRINTF("%s: Internal FW Error @ RISC Addr 0x%x\n",
< isp->isp_name, mbox);
< isp_restart(isp);
---
> isp_prt(isp, ISP_LOGERR,
> "Internal FW Error @ RISC Addr 0x%x", mbox);
> isp_reinit(isp);
2794c2804
< PRINTF("%s: Request Queue Transfer Error\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "Request Queue Transfer Error");
2798c2808
< PRINTF("%s: Response Queue Transfer Error\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "Response Queue Transfer Error");
2811,2812c2821,2822
< PRINTF("%s: timeout initiated SCSI bus reset of bus %d\n",
< isp->isp_name, bus);
---
> isp_prt(isp, ISP_LOGWARN,
> "timeout initiated SCSI bus reset of bus %d\n", bus);
2820c2830
< PRINTF("%s: device reset on bus %d\n", isp->isp_name, bus);
---
> isp_prt(isp, ISP_LOGINFO, "device reset on bus %d", bus);
2828c2838
< PRINTF("%s: extended message underrun\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGWARN, "extended message underrun");
2832c2842
< PRINTF("%s: SCAM interrupt\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGINFO, "SCAM interrupt");
2836,2837c2846,2847
< PRINTF("%s: stalled SCSI Bus after DATA Overrun\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR,
> "stalled SCSI Bus after DATA Overrun");
2842,2843c2852
< PRINTF("%s: SCSI Bus reset after DATA Overrun\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "SCSI Bus reset after DATA Overrun");
2850c2859
< PRINTF("%s: Transition to LVD mode\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGINFO, "Transition to LVD mode");
2856,2857c2865,2866
< PRINTF("%s: Transition to Differential mode\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGINFO,
> "Transition to Differential mode");
2863,2864c2872,2873
< PRINTF("%s: Transition to Single Ended mode\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGINFO,
> "Transition to Single Ended mode");
2870,2871c2879,2880
< PRINTF("%s: Transition to unknown mode 0x%x\n",
< isp->isp_name, mbox);
---
> isp_prt(isp, ISP_LOGWARN,
> "Transition to Unknown Mode 0x%x", mbox);
2884,2885c2893,2894
< IDPRINTF(4, ("%s: fast post completion of %u\n", isp->isp_name,
< fast_post_handle));
---
> isp_prt(isp, ISP_LOGDEBUG3, "fast post completion of %u",
> fast_post_handle);
2890c2899
< PRINTF("%s: CTIO done\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGDEBUG3, "Fast Posting CTIO done");
2900c2909
< IDPRINTF(1, ("%s: LIP occurred\n", isp->isp_name));
---
> isp_prt(isp, ISP_LOGINFO, "LIP occurred");
2933c2942
< PRINTF("%s: Loop RESET\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGINFO, "Loop RESET");
2943c2952
< IDPRINTF(1, ("%s: Port Database Changed\n", isp->isp_name));
---
> isp_prt(isp, ISP_LOGINFO, "Port Database Changed");
2967c2976
< PRINTF("%s: Point-to-Point mode\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGINFO, "Point-to-Point mode");
2974,2975c2983
< PRINTF("%s: Point-to-Point -> Loop mode\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGINFO, "Point-to-Point->Loop mode");
2978,2979c2986
< PRINTF("%s: Loop -> Point-to-Point mode\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGINFO, "Loop->Point-to-Point mode");
2982,2983c2989,2990
< PRINTF("%s: Point-to-Point -> Loop mode (1)\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGWARN,
> "Point-to-Point->Loop mode (1)");
2986,2987c2993,2994
< PRINTF("%s: FATAL CONNECTION ERROR\n", isp->isp_name);
< isp_restart(isp);
---
> isp_prt(isp, ISP_LOGERR, "FATAL CONNECTION ERROR");
> isp_reinit(isp);
2992,2993c2999,3000
< PRINTF("%s: Looped Back in Point-to-Point mode\n",
< isp->isp_name);
---
> isp_prt(isp, ISP_LOGWARN,
> "Looped Back in Point-to-Point mode");
2998c3005
< PRINTF("%s: unknown async code 0x%x\n", isp->isp_name, mbox);
---
> isp_prt(isp, ISP_LOGWARN, "Unknown Async Code 0x%x", mbox);
3029a3037
> optrp = optrp;
3034c3042
< PRINTF("%s: unhandled response type 0x%x\n", isp->isp_name,
---
> isp_prt(isp, ISP_LOGWARN, "Unhandled Response Type 0x%x",
3044c3052
< ISP_SCSI_XFER_T *xs;
---
> XS_T *xs;
3046c3054
< switch (sp->req_completion_status) {
---
> switch (sp->req_completion_status & 0xff) {
3048c3056,3058
< XS_SETERR(xs, HBA_NOERROR);
---
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_NOERROR);
> }
3053,3056c3063,3068
< IDPRINTF(3, ("%s: Selection Timeout for %d.%d.%d\n",
< isp->isp_name, XS_TGT(xs), XS_LUN(xs),
< XS_CHANNEL(xs)));
< XS_SETERR(xs, HBA_SELTIMEOUT);
---
> isp_prt(isp, ISP_LOGDEBUG0,
> "Selection Timeout for %d.%d.%d",
> XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_SELTIMEOUT);
> }
3059,3060c3071,3073
< PRINTF("%s: command incomplete for %d.%d.%d, state 0x%x\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs),
---
> isp_prt(isp, ISP_LOGERR,
> "command incomplete for %d.%d.%d, state 0x%x",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs),
3065,3066c3078,3079
< PRINTF("%s: DMA error for command on %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR, "DMA error for command on %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3070,3072c3083,3135
< PRINTF("%s: transport error for %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
< isp_prtstst(sp);
---
> {
> char buf[172];
> buf[0] = 0;
> STRNCAT(buf, "states=>", sizeof buf);
> if (sp->req_state_flags & RQSF_GOT_BUS) {
> STRNCAT(buf, " GOT_BUS", sizeof buf);
> }
> if (sp->req_state_flags & RQSF_GOT_TARGET) {
> STRNCAT(buf, " GOT_TGT", sizeof buf);
> }
> if (sp->req_state_flags & RQSF_SENT_CDB) {
> STRNCAT(buf, " SENT_CDB", sizeof buf);
> }
> if (sp->req_state_flags & RQSF_XFRD_DATA) {
> STRNCAT(buf, " XFRD_DATA", sizeof buf);
> }
> if (sp->req_state_flags & RQSF_GOT_STATUS) {
> STRNCAT(buf, " GOT_STS", sizeof buf);
> }
> if (sp->req_state_flags & RQSF_GOT_SENSE) {
> STRNCAT(buf, " GOT_SNS", sizeof buf);
> }
> if (sp->req_state_flags & RQSF_XFER_COMPLETE) {
> STRNCAT(buf, " XFR_CMPLT", sizeof buf);
> }
> STRNCAT(buf, "\nstatus=>", sizeof buf);
> if (sp->req_status_flags & RQSTF_DISCONNECT) {
> STRNCAT(buf, " Disconnect", sizeof buf);
> }
> if (sp->req_status_flags & RQSTF_SYNCHRONOUS) {
> STRNCAT(buf, " Sync_xfr", sizeof buf);
> }
> if (sp->req_status_flags & RQSTF_PARITY_ERROR) {
> STRNCAT(buf, " Parity", sizeof buf);
> }
> if (sp->req_status_flags & RQSTF_BUS_RESET) {
> STRNCAT(buf, " Bus_Reset", sizeof buf);
> }
> if (sp->req_status_flags & RQSTF_DEVICE_RESET) {
> STRNCAT(buf, " Device_Reset", sizeof buf);
> }
> if (sp->req_status_flags & RQSTF_ABORTED) {
> STRNCAT(buf, " Aborted", sizeof buf);
> }
> if (sp->req_status_flags & RQSTF_TIMEOUT) {
> STRNCAT(buf, " Timeout", sizeof buf);
> }
> if (sp->req_status_flags & RQSTF_NEGOTIATION) {
> STRNCAT(buf, " Negotiation", sizeof buf);
> }
> isp_prt(isp, ISP_LOGERR, "%s", buf);
> isp_prt(isp, ISP_LOGERR, "transport error for %d.%d.%d:\n%s",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs), buf);
3074c3137
<
---
> }
3076,3077c3139,3141
< IDPRINTF(1, ("%s: bus reset destroyed command for %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)));
---
> isp_prt(isp, ISP_LOGWARN,
> "bus reset destroyed command for %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3079c3143,3145
< XS_SETERR(xs, HBA_BUSRESET);
---
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_BUSRESET);
> }
3083,3084c3149,3150
< PRINTF("%s: command aborted for %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR, "command aborted for %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3086c3152,3154
< XS_SETERR(xs, HBA_ABORTED);
---
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_ABORTED);
> }
3090,3092c3158,3162
< IDPRINTF(2, ("%s: command timed out for %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)));
< XS_SETERR(xs, HBA_CMDTIMEOUT);
---
> isp_prt(isp, ISP_LOGWARN, "command timed out for %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_CMDTIMEOUT);
> }
3100,3102c3170,3174
< PRINTF("%s: data overrun for command on %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
< XS_SETERR(xs, HBA_DATAOVR);
---
> isp_prt(isp, ISP_LOGERR, "data overrun for command on %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_DATAOVR);
> }
3106,3107c3178,3180
< PRINTF("%s: command overrun for command on %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "command overrun for command on %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3111,3112c3184,3186
< PRINTF("%s: status overrun for command on %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "status overrun for command on %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3116,3117c3190,3192
< PRINTF("%s: msg not COMMAND COMPLETE after status %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "msg not COMMAND COMPLETE after status %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3121,3122c3196,3198
< PRINTF("%s: No MESSAGE OUT phase after selection on %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "No MESSAGE OUT phase after selection on %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3126,3127c3202,3203
< PRINTF("%s: EXTENDED IDENTIFY failed %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR, "EXTENDED IDENTIFY failed %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3131,3132c3207,3209
< PRINTF("%s: INITIATOR DETECTED ERROR rejected by %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "INITIATOR DETECTED ERROR rejected by %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3136,3137c3213,3214
< PRINTF("%s: ABORT OPERATION rejected by %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR, "ABORT OPERATION rejected by %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3141,3142c3218,3219
< PRINTF("%s: MESSAGE REJECT rejected by %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR, "MESSAGE REJECT rejected by %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3146,3147c3223,3224
< PRINTF("%s: NOP rejected by %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR, "NOP rejected by %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3151,3152c3228,3230
< PRINTF("%s: MESSAGE PARITY ERROR rejected by %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "MESSAGE PARITY ERROR rejected by %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3156,3157c3234,3236
< PRINTF("%s: BUS DEVICE RESET rejected by %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGWARN,
> "BUS DEVICE RESET rejected by %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3161,3162c3240,3241
< PRINTF("%s: IDENTIFY rejected by %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR, "IDENTIFY rejected by %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3166,3167c3245,3246
< PRINTF("%s: %d.%d.%d had an unexpected bus free\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR, "%d.%d.%d had an unexpected bus free",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
3174c3253,3255
< XS_SETERR(xs, HBA_NOERROR);
---
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_NOERROR);
> }
3178,3179c3259
< PRINTF("%s: HBA attempted queued transaction with disconnect "
< "not set for %d.%d.%d\n", isp->isp_name, XS_CHANNEL(xs),
---
> isp_prt(isp, ISP_LOGERR, xact1, XS_CHANNEL(xs),
3184,3185c3264
< PRINTF("%s: HBA attempted queued transaction to target "
< "routine %d on target %d, bus %d\n", isp->isp_name,
---
> isp_prt(isp, ISP_LOGERR, xact2,
3190,3192c3269,3270
< PRINTF("%s: HBA attempted queued transaction for target %d lun "
< "%d on bus %d when queueing disabled\n", isp->isp_name,
< XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
---
> isp_prt(isp, ISP_LOGERR, xact3, XS_TGT(xs),
> XS_LUN(xs), XS_CHANNEL(xs));
3196c3274
< PRINTF("%s: invalid IOCB entry type detected\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "Invalid IOCB entry type detected");
3200,3202c3278,3280
< IDPRINTF(3, ("%s: internal queues full for target %d lun %d "
< "bus %d, status 0x%x\n", isp->isp_name, XS_TGT(xs),
< XS_LUN(xs), XS_CHANNEL(xs), XS_STS(xs)));
---
> isp_prt(isp, ISP_LOGDEBUG1,
> "internal queues full for %d.%d.%d status 0x%x", XS_TGT(xs),
> XS_LUN(xs), XS_CHANNEL(xs), *XS_STSP(xs));
3207c3285
< if (XS_STS(xs) != 0) {
---
> if (*XS_STSP(xs) != SCSI_GOOD && XS_NOERR(xs)) {
3214,3216c3292,3293
< PRINTF("%s: SCSI phase skipped (e.g., COMMAND COMPLETE w/o "
< "STATUS phase) for target %d lun %d bus %d\n",
< isp->isp_name, XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
---
> isp_prt(isp, ISP_LOGERR, pskip,
> XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
3220,3221c3297,3302
< PRINTF("%s: Auto Request Sense failed for %d.%d.%d\n",
< isp->isp_name, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "Auto Request Sense failed for %d.%d.%d",
> XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs));
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_ARQFAIL);
> }
3225,3226c3306,3308
< PRINTF("%s: Wide Negotiation failed for %d.%d.%d\n",
< isp->isp_name, XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "Wide Negotiation failed for %d.%d.%d",
> XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
3234c3316,3318
< XS_SETERR(xs, HBA_NOERROR);
---
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_NOERROR);
> }
3238,3239c3322,3324
< PRINTF("%s: SDTR Message failed for target %d.%d.%d\n",
< isp->isp_name, XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "SDTR Message failed for target %d.%d.%d",
> XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
3250,3251c3335,3337
< PRINTF("%s: Bad LVD condition while talking to %d.%d.%d\n",
< isp->isp_name, XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
---
> isp_prt(isp, ISP_LOGERR,
> "Bad LVD condition while talking to %d.%d.%d",
> XS_TGT(xs), XS_LUN(xs), XS_CHANNEL(xs));
3258,3260c3344,3348
< IDPRINTF(3, ("%s: Port Unavailable for target %d\n",
< isp->isp_name, XS_TGT(xs)));
< XS_SETERR(xs, HBA_SELTIMEOUT);
---
> isp_prt(isp, ISP_LOGINFO,
> "Port Unavailable for target %d", XS_TGT(xs));
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_SELTIMEOUT);
> }
3267,3269c3355,3359
< IDPRINTF(2, ("%s: port logout for target %d\n",
< isp->isp_name, XS_TGT(xs)));
< XS_SETERR(xs, HBA_SELTIMEOUT);
---
> isp_prt(isp, ISP_LOGINFO,
> "port logout for target %d", XS_TGT(xs));
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_SELTIMEOUT);
> }
3273,3275c3363,3367
< PRINTF("%s: port changed for target %d\n",
< isp->isp_name, XS_TGT(xs));
< XS_SETERR(xs, HBA_SELTIMEOUT);
---
> isp_prt(isp, ISP_LOGWARN,
> "port changed for target %d", XS_TGT(xs));
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_SELTIMEOUT);
> }
3279,3281c3371,3375
< PRINTF("%s: port busy for target %d\n",
< isp->isp_name, XS_TGT(xs));
< XS_SETERR(xs, HBA_TGTBSY);
---
> isp_prt(isp, ISP_LOGWARN,
> "port busy for target %d", XS_TGT(xs));
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_TGTBSY);
> }
3285,3286c3379,3380
< PRINTF("%s: completion status 0x%x\n",
< isp->isp_name, sp->req_completion_status);
---
> isp_prt(isp, ISP_LOGERR, "Unknown Completion Status 0x%x",
> sp->req_completion_status);
3289c3383,3385
< XS_SETERR(xs, HBA_BOTCH);
---
> if (XS_NOERR(xs)) {
> XS_SETERR(xs, HBA_BOTCH);
> }
3297c3393
< ISP_SCSI_XFER_T *xs;
---
> XS_T *xs;
3304,3305c3400,3401
< PRINTF("%s: command for fast posting handle 0x%x not found\n",
< isp->isp_name, fph);
---
> isp_prt(isp, ISP_LOGWARN,
> "Command for fast post handle 0x%x not found", fph);
3314a3411
> XS_SET_STATE_STAT(isp, xs, NULL);
3316c3413
< XS_STS(xs) = 0;
---
> *XS_STSP(xs) = SCSI_GOOD;
3320c3417
< XS_CMD_DONE(xs);
---
> isp_done(xs);
3424a3522,3620
> #ifndef ISP_STRIPEED
> static char *scsi_mbcmd_names[] = {
> "NO-OP",
> "LOAD RAM",
> "EXEC FIRMWARE",
> "DUMP RAM",
> "WRITE RAM WORD",
> "READ RAM WORD",
> "MAILBOX REG TEST",
> "VERIFY CHECKSUM",
> "ABOUT FIRMWARE",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "CHECK FIRMWARE",
> NULL,
> "INIT REQUEST QUEUE",
> "INIT RESULT QUEUE",
> "EXECUTE IOCB",
> "WAKE UP",
> "STOP FIRMWARE",
> "ABORT",
> "ABORT DEVICE",
> "ABORT TARGET",
> "BUS RESET",
> "STOP QUEUE",
> "START QUEUE",
> "SINGLE STEP QUEUE",
> "ABORT QUEUE",
> "GET DEV QUEUE STATUS",
> NULL,
> "GET FIRMWARE STATUS",
> "GET INIT SCSI ID",
> "GET SELECT TIMEOUT",
> "GET RETRY COUNT",
> "GET TAG AGE LIMIT",
> "GET CLOCK RATE",
> "GET ACT NEG STATE",
> "GET ASYNC DATA SETUP TIME",
> "GET PCI PARAMS",
> "GET TARGET PARAMS",
> "GET DEV QUEUE PARAMS",
> "GET RESET DELAY PARAMS",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "SET INIT SCSI ID",
> "SET SELECT TIMEOUT",
> "SET RETRY COUNT",
> "SET TAG AGE LIMIT",
> "SET CLOCK RATE",
> "SET ACT NEG STATE",
> "SET ASYNC DATA SETUP TIME",
> "SET PCI CONTROL PARAMS",
> "SET TARGET PARAMS",
> "SET DEV QUEUE PARAMS",
> "SET RESET DELAY PARAMS",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "RETURN BIOS BLOCK ADDR",
> "WRITE FOUR RAM WORDS",
> "EXEC BIOS IOCB",
> NULL,
> NULL,
> "SET SYSTEM PARAMETER",
> "GET SYSTEM PARAMETER",
> NULL,
> "GET SCAM CONFIGURATION",
> "SET SCAM CONFIGURATION",
> "SET FIRMWARE FEATURES",
> "GET FIRMWARE FEATURES",
> NULL,
> NULL,
> NULL,
> NULL,
> "LOAD RAM A64",
> "DUMP RAM A64",
> "INITIALIZE REQUEST QUEUE A64",
> "INITIALIZE RESPONSE QUEUE A64",
> "EXECUTE IOCB A64",
> "ENABLE TARGET MODE",
> NULL,
> NULL,
> NULL,
> NULL,
> "SET DATA OVERRUN RECOVERY MODE",
> "GET DATA OVERRUN RECOVERY MODE",
> "SET HOST DATA",
> "GET NOST DATA",
> };
> #endif
>
3554a3751,3882
> #ifndef ISP_STRIPPED
> static char *fc_mbcmd_names[] = {
> "NO-OP",
> "LOAD RAM",
> "EXEC FIRMWARE",
> "DUMP RAM",
> "WRITE RAM WORD",
> "READ RAM WORD",
> "MAILBOX REG TEST",
> "VERIFY CHECKSUM",
> "ABOUT FIRMWARE",
> "LOAD RAM",
> "DUMP RAM",
> NULL,
> NULL,
> NULL,
> "CHECK FIRMWARE",
> NULL,
> "INIT REQUEST QUEUE",
> "INIT RESULT QUEUE",
> "EXECUTE IOCB",
> "WAKE UP",
> "STOP FIRMWARE",
> "ABORT",
> "ABORT DEVICE",
> "ABORT TARGET",
> "BUS RESET",
> "STOP QUEUE",
> "START QUEUE",
> "SINGLE STEP QUEUE",
> "ABORT QUEUE",
> "GET DEV QUEUE STATUS",
> NULL,
> "GET FIRMWARE STATUS",
> "GET LOOP ID",
> NULL,
> "GET RETRY COUNT",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "GET FIRMWARE OPTIONS",
> "GET PORT QUEUE PARAMS",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "SET RETRY COUNT",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "SET FIRMWARE OPTIONS",
> "SET PORT QUEUE PARAMS",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "LOOP PORT BYPASS",
> "LOOP PORT ENABLE",
> "GET RESOURCE COUNTS",
> "REQUEST NON PARTICIPATING MODE",
> NULL,
> NULL,
> NULL,
> "GET PORT DATABASE,, ENHANCED",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "EXECUTE IOCB A64",
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> NULL,
> "INIT FIRMWARE",
> NULL,
> "INIT LIP",
> "GET FC-AL POSITION MAP",
> "GET PORT DATABASE",
> "CLEAR ACA",
> "TARGET RESET",
> "CLEAR TASK SET",
> "ABORT TASK SET",
> "GET FW STATE",
> "GET PORT NAME",
> "GET LINK STATUS",
> "INIT LIP RESET",
> NULL,
> "SEND SNS",
> "FABRIC LOGIN",
> "SEND CHANGE REQUEST",
> "FABRIC LOGOUT",
> "INIT LIP LOGIN",
> NULL,
> "LOGIN LOOP PORT",
> "GET PORT/NODE NAME LIST",
> "SET VENDOR ID",
> "INITIALIZE IP MAILBOX",
> NULL,
> NULL,
> NULL,
> NULL,
> "Get ID List",
> "SEND LFA",
> "Lun RESET"
> };
> #endif
>
3556c3884
< isp_mboxcmd(isp, mbp)
---
> isp_mboxcmd(isp, mbp, logmask)
3558a3887
> int logmask;
3559a3889
> char *cname, *xname, tname[16], mname[16];
3573c3903
< PRINTF("%s: unknown command 0x%x\n", isp->isp_name, opcode);
---
> isp_prt(isp, ISP_LOGERR, "Unknown Command 0x%x", opcode);
3582,3583c3912
< PRINTF("%s: no parameters for opcode 0x%x\n", isp->isp_name,
< opcode);
---
> isp_prt(isp, ISP_LOGERR, "no parameters for 0x%x", opcode);
3586a3916,3920
> /*
> * Get exclusive usage of mailbox registers.
> */
> MBOX_ACQUIRE(isp);
>
3607c3941
< SYS_DELAY(250);
---
> USEC_DELAY(250);
3623a3958,3971
> MBOX_RELEASE(isp);
>
> if (logmask == 0 || opcode == MBOX_EXEC_FIRMWARE) {
> return;
> }
> #ifdef ISP_STRIPPED
> cname = NULL;
> #else
> cname = (IS_FC(isp))? fc_mbcmd_names[opcode] : scsi_mbcmd_names[opcode];
> #endif
> if (cname == NULL) {
> SNPRINTF(cname, sizeof tname, "opcode %x", opcode);
> }
>
3626a3975
> xname = NULL;
3631,3632c3980,3981
< IDPRINTF(2, ("%s: mbox cmd %x failed with INVALID_COMMAND\n",
< isp->isp_name, opcode));
---
> if (logmask & MBLOGMASK(MBOX_COMMAND_COMPLETE))
> xname = "INVALID COMMAND";
3635,3636c3984,3985
< PRINTF("%s: mbox cmd %x failed with HOST_INTERFACE_ERROR\n",
< isp->isp_name, opcode);
---
> if (logmask & MBLOGMASK(MBOX_HOST_INTERFACE_ERROR))
> xname = "HOST INTERFACE ERROR";
3639,3640c3988,3989
< PRINTF("%s: mbox cmd %x failed with TEST_FAILED\n",
< isp->isp_name, opcode);
---
> if (logmask & MBLOGMASK(MBOX_TEST_FAILED))
> xname = "TEST FAILED";
3643,3645c3992,3993
< if (opcode != MBOX_ABOUT_FIRMWARE)
< PRINTF("%s: mbox cmd %x failed with COMMAND_ERROR\n",
< isp->isp_name, opcode);
---
> if (logmask & MBLOGMASK(MBOX_COMMAND_ERROR))
> xname = "COMMAND ERROR";
3648,3656c3996,3997
< switch (opcode) {
< case MBOX_GET_PORT_DB:
< case MBOX_GET_PORT_NAME:
< case MBOX_GET_DEV_QUEUE_PARAMS:
< break;
< default:
< PRINTF("%s: mbox cmd %x failed with "
< "COMMAND_PARAM_ERROR\n", isp->isp_name, opcode);
< }
---
> if (logmask & MBLOGMASK(MBOX_COMMAND_PARAM_ERROR))
> xname = "COMMAND PARAMETER ERROR";
3658d3998
<
3659a4000,4002
> if (logmask & MBLOGMASK(MBOX_LOOP_ID_USED))
> xname = "LOOP ID ALREADY IN USE";
> break;
3660a4004,4006
> if (logmask & MBLOGMASK(MBOX_PORT_ID_USED))
> xname = "PORT ID ALREADY IN USE";
> break;
3661a4008,4009
> if (logmask & MBLOGMASK(MBOX_ALL_IDS_USED))
> xname = "ALL LOOP IDS IN USE";
3663c4011,4013
<
---
> case 0: /* special case */
> xname = "TIMEOUT";
> break;
3665,3672c4015,4016
< /*
< * The expected return of EXEC_FIRMWARE is zero.
< */
< if ((opcode == MBOX_EXEC_FIRMWARE && mbp->param[0] != 0) ||
< (opcode != MBOX_EXEC_FIRMWARE)) {
< PRINTF("%s: mbox cmd %x failed with error %x\n",
< isp->isp_name, opcode, mbp->param[0]);
< }
---
> SNPRINTF(mname, sizeof mname, "error 0x%x", mbp->param[0]);
> xname = mname;
3674a4019,4021
> if (xname)
> isp_prt(isp, ISP_LOGALL, "Mailbox Command '%s' failed (%s)",
> cname, xname);
3677,3713d4023
< void
< isp_lostcmd(isp, xs)
< struct ispsoftc *isp;
< ISP_SCSI_XFER_T *xs;
< {
< mbreg_t mbs;
<
< mbs.param[0] = MBOX_GET_FIRMWARE_STATUS;
< isp_mboxcmd(isp, &mbs);
< if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
< isp_dumpregs(isp, "couldn't GET FIRMWARE STATUS");
< return;
< }
< if (mbs.param[1]) {
< PRINTF("%s: %d commands on completion queue\n",
< isp->isp_name, mbs.param[1]);
< }
< if (XS_NULL(xs))
< return;
<
< mbs.param[0] = MBOX_GET_DEV_QUEUE_STATUS;
< mbs.param[1] = (XS_TGT(xs) << 8) | XS_LUN(xs); /* XXX: WHICH BUS? */
< isp_mboxcmd(isp, &mbs);
< if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
< isp_dumpregs(isp, "couldn't GET DEVICE QUEUE STATUS");
< return;
< }
< PRINTF("%s: lost command for target %d lun %d, %d active of %d, "
< "Queue State: %x\n", isp->isp_name, XS_TGT(xs),
< XS_LUN(xs), mbs.param[2], mbs.param[3], mbs.param[1]);
<
< isp_dumpregs(isp, "lost command");
< /*
< * XXX: Need to try and do something to recover.
< */
< }
<
3715,3750d4024
< isp_dumpregs(isp, msg)
< struct ispsoftc *isp;
< const char *msg;
< {
< PRINTF("%s: %s\n", isp->isp_name, msg);
< if (IS_SCSI(isp))
< PRINTF(" biu_conf1=%x", ISP_READ(isp, BIU_CONF1));
< else
< PRINTF(" biu_csr=%x", ISP_READ(isp, BIU2100_CSR));
< PRINTF(" biu_icr=%x biu_isr=%x biu_sema=%x ", ISP_READ(isp, BIU_ICR),
< ISP_READ(isp, BIU_ISR), ISP_READ(isp, BIU_SEMA));
< PRINTF("risc_hccr=%x\n", ISP_READ(isp, HCCR));
<
<
< if (IS_SCSI(isp)) {
< ISP_WRITE(isp, HCCR, HCCR_CMD_PAUSE);
< PRINTF(" cdma_conf=%x cdma_sts=%x cdma_fifostat=%x\n",
< ISP_READ(isp, CDMA_CONF), ISP_READ(isp, CDMA_STATUS),
< ISP_READ(isp, CDMA_FIFO_STS));
< PRINTF(" ddma_conf=%x ddma_sts=%x ddma_fifostat=%x\n",
< ISP_READ(isp, DDMA_CONF), ISP_READ(isp, DDMA_STATUS),
< ISP_READ(isp, DDMA_FIFO_STS));
< PRINTF(" sxp_int=%x sxp_gross=%x sxp(scsi_ctrl)=%x\n",
< ISP_READ(isp, SXP_INTERRUPT),
< ISP_READ(isp, SXP_GROSS_ERR),
< ISP_READ(isp, SXP_PINS_CTRL));
< ISP_WRITE(isp, HCCR, HCCR_CMD_RELEASE);
< }
< PRINTF(" mbox regs: %x %x %x %x %x\n",
< ISP_READ(isp, OUTMAILBOX0), ISP_READ(isp, OUTMAILBOX1),
< ISP_READ(isp, OUTMAILBOX2), ISP_READ(isp, OUTMAILBOX3),
< ISP_READ(isp, OUTMAILBOX4));
< ISP_DUMPREGS(isp);
< }
<
< static void
3754d4027
< mbreg_t mbs;
3756c4029
< int once = 0;
---
> mbreg_t mbs;
3758c4031
< again:
---
>
3760,3797c4033,4035
< isp_mboxcmd(isp, &mbs);
< if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
< IDPRINTF(1, ("%s: isp_fw_state 0x%x\n", isp->isp_name,
< mbs.param[0]));
< switch (mbs.param[0]) {
< case ASYNC_PDB_CHANGED:
< if (once++ < 10) {
< goto again;
< }
< fcp->isp_fwstate = FW_CONFIG_WAIT;
< fcp->isp_loopstate = LOOP_PDB_RCVD;
< goto again;
< case ASYNC_LIP_OCCURRED:
< fcp->isp_lipseq = mbs.param[1];
< /* FALLTHROUGH */
< case ASYNC_LOOP_UP:
< fcp->isp_fwstate = FW_CONFIG_WAIT;
< fcp->isp_loopstate = LOOP_LIP_RCVD;
< if (once++ < 10) {
< goto again;
< }
< break;
< case ASYNC_LOOP_RESET:
< case ASYNC_LOOP_DOWN:
< fcp->isp_fwstate = FW_CONFIG_WAIT;
< fcp->isp_loopstate = LOOP_NIL;
< /* FALLTHROUGH */
< case ASYNC_CHANGE_NOTIFY:
< if (once++ < 10) {
< goto again;
< }
< break;
< }
< PRINTF("%s: GET FIRMWARE STATE failed (0x%x)\n",
< isp->isp_name, mbs.param[0]);
< return;
< }
< fcp->isp_fwstate = mbs.param[1];
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
> if (mbs.param[0] == MBOX_COMMAND_COMPLETE)
> fcp->isp_fwstate = mbs.param[1];
3836,3837c4074,4075
< IDPRINTF(2, ("%s: skipping target %d bus %d update\n",
< isp->isp_name, tgt, bus));
---
> isp_prt(isp, ISP_LOGDEBUG1,
> "skipping target %d bus %d update", tgt, bus);
3876,3879c4114,4117
< IDPRINTF(3, ("%s: bus %d set tgt %d flags 0x%x off 0x%x"
< " period 0x%x\n", isp->isp_name, bus, tgt,
< mbs.param[2], mbs.param[3] >> 8,
< mbs.param[3] & 0xff));
---
> isp_prt(isp, ISP_LOGDEBUG2,
> "bus %d set tgt %d flags 0x%x off 0x%x period 0x%x",
> bus, tgt, mbs.param[2], mbs.param[3] >> 8,
> mbs.param[3] & 0xff);
3889,3895c4127
< isp_mboxcmd(isp, &mbs);
< if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
< PRINTF("%s: failed to %cet SCSI parameters for "
< "target %d\n", isp->isp_name, (get)? 'g' : 's',
< tgt);
< continue;
< }
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
3934,3941c4166,4168
< fcp->isp_nodewwn = DEFAULT_WWN(isp);
< if ((fcp->isp_nodewwn >> 60) == 2) {
< fcp->isp_nodewwn &= ~((u_int64_t) 0xfff << 48);
< fcp->isp_portwwn = fcp->isp_nodewwn |
< (((u_int64_t)(isp->isp_unit+1)) << 48);
< } else {
< fcp->isp_portwwn = fcp->isp_nodewwn;
< }
---
> fcp->isp_nodewwn = DEFAULT_NODEWWN(isp);
> fcp->isp_portwwn = DEFAULT_PORTWWN(isp);
>
3947,3948c4174,4176
< PRINTF("%s: Node WWN 0x%08x%08x, Port WWN 0x%08x%08x\n",
< isp->isp_name, (u_int32_t) (fcp->isp_nodewwn >> 32),
---
> isp_prt(isp, ISP_LOGINFO,
> "Node WWN 0x%08x%08x, Port WWN 0x%08x%08x",
> (u_int32_t) (fcp->isp_nodewwn >> 32),
3984c4212
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
3986d4213
< IDPRINTF(2, ("could not GET ACT NEG STATE\n"));
4000,4003c4227,4232
< IDPRINTF(3, ("%s: defaulting bus %d REQ/ACK Active Negation is %d\n",
< isp->isp_name, channel, sdp->isp_req_ack_active_neg));
< IDPRINTF(3, ("%s: defaulting bus %d DATA Active Negation is %d\n",
< isp->isp_name, channel, sdp->isp_data_line_active_neg));
---
> isp_prt(isp, ISP_LOGDEBUG1,
> "defaulting bus %d REQ/ACK Active Negation is %d",
> channel, sdp->isp_req_ack_active_neg);
> isp_prt(isp, ISP_LOGDEBUG1,
> "defaulting bus %d DATA Active Negation is %d",
> channel, sdp->isp_data_line_active_neg);
4050c4279
< isp_mboxcmd(isp, &mbs);
---
> isp_mboxcmd(isp, &mbs, MBLOGALL);
4086,4088c4315,4317
< IDPRINTF(3, ("%s: bus %d tgt %d flags %x offset %x period %x\n",
< isp->isp_name, channel, tgt,
< sdp->isp_devparam[tgt].dev_flags,
---
> isp_prt(isp, ISP_LOGDEBUG1,
> "bus %d tgt %d flags %x offset %x period %x",
> channel, tgt, sdp->isp_devparam[tgt].dev_flags,
4090c4319
< sdp->isp_devparam[tgt].sync_period));
---
> sdp->isp_devparam[tgt].sync_period);
4099,4100c4328
< sdp->isp_initiator_id = 7;
< /* XXXX This is probably based upon clock XXXX */
---
> sdp->isp_initiator_id = DEFAULT_IID(isp);
4107c4335
< sdp->isp_max_queue_depth = MAXISPREQUEST;
---
> sdp->isp_max_queue_depth = MAXISPREQUEST(isp);
4128c4356
< isp_restart(isp)
---
> isp_reinit(isp)
4131c4359
< ISP_SCSI_XFER_T *xs;
---
> XS_T *xs;
4142c4370
< PRINTF("%s: isp_restart cannot restart ISP\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGERR, "isp_reinit cannot restart ISP");
4146c4374
< for (handle = 1; handle <= (int) isp->isp_maxcmds; handle++) {
---
> for (handle = 1; (int) handle <= isp->isp_maxcmds; handle++) {
4159c4387
< XS_CMD_DONE(xs);
---
> isp_done(xs);
4200,4202c4428,4430
< PRINTF("%s: invalid NVRAM header (%x,%x,%x,%x)\n",
< isp->isp_name, nvram_data[0], nvram_data[1],
< nvram_data[2], nvram_data[3]);
---
> isp_prt(isp, ISP_LOGWARN, "invalid NVRAM header");
> isp_prt(isp, ISP_LOGDEBUG0, "%x %x %x",
> nvram_data[0], nvram_data[1], nvram_data[2]);
4213c4441
< PRINTF("%s: invalid NVRAM checksum\n", isp->isp_name);
---
> isp_prt(isp, ISP_LOGWARN, "invalid NVRAM checksum");
4217c4445
< PRINTF("%s: version %d NVRAM not understood\n", isp->isp_name,
---
> isp_prt(isp, ISP_LOGWARN, "version %d NVRAM not understood",
4235d4462
< IDPRINTF(3, ("%s: NVRAM is valid\n", isp->isp_name));
4251c4478
< SYS_DELAY(2);
---
> USEC_DELAY(2);
4253c4480
< SYS_DELAY(2);
---
> USEC_DELAY(2);
4279c4506
< SYS_DELAY(2);
---
> USEC_DELAY(2);
4281c4508
< SYS_DELAY(2);
---
> USEC_DELAY(2);
4283c4510
< SYS_DELAY(2);
---
> USEC_DELAY(2);
4293c4520
< SYS_DELAY(2);
---
> USEC_DELAY(2);
4298c4525
< SYS_DELAY(2);
---
> USEC_DELAY(2);
4300c4527
< SYS_DELAY(2);
---
> USEC_DELAY(2);
4303,4306c4530,4531
< SYS_DELAY(2);
< #if BYTE_ORDER == BIG_ENDIAN
< *rp = ((*rp >> 8) | ((*rp & 0xff) << 8));
< #endif
---
> USEC_DELAY(2);
> ISP_SWIZZLE_NVRAM_WORD(isp, rp);
4315,4316d4539
< static char *tru = "true";
< static char *not = "false";
4370,4398d4592
< if (isp->isp_dblev > 2) {
< PRINTF("%s: NVRAM values:\n", isp->isp_name);
< PRINTF(" Fifo Threshold = 0x%x\n",
< sdp->isp_fifo_threshold);
< PRINTF(" Bus Reset Delay = %d\n",
< sdp->isp_bus_reset_delay);
< PRINTF(" Retry Count = %d\n",
< sdp->isp_retry_count);
< PRINTF(" Retry Delay = %d\n",
< sdp->isp_retry_delay);
< PRINTF(" Tag Age Limit = %d\n",
< sdp->isp_tag_aging);
< PRINTF(" Selection Timeout = %d\n",
< sdp->isp_selection_timeout);
< PRINTF(" Max Queue Depth = %d\n",
< sdp->isp_max_queue_depth);
< PRINTF(" Async Data Setup = 0x%x\n",
< sdp->isp_async_data_setup);
< PRINTF(" REQ/ACK Active Negation = %s\n",
< sdp->isp_req_ack_active_neg? tru : not);
< PRINTF(" Data Line Active Negation = %s\n",
< sdp->isp_data_line_active_neg? tru : not);
< PRINTF(" Data DMA Burst Enable = %s\n",
< sdp->isp_data_dma_burst_enabl? tru : not);
< PRINTF(" Cmd DMA Burst Enable = %s\n",
< sdp->isp_cmd_dma_burst_enable? tru : not);
< PRINTF(" Fast MTTR = %s\n",
< isp->isp_fast_mttr? tru : not);
< }
4415,4416c4609
< sdp->isp_devparam[i].sync_period =
< 0x19;
---
> sdp->isp_devparam[i].sync_period = 0x19;
4419,4420c4612
< sdp->isp_devparam[i].sync_offset =
< 0x0c;
---
> sdp->isp_devparam[i].sync_offset = 0x0c;
4430,4433d4621
< if (ISP_NVRAM_TGT_QFRZ(nvram_data, i)) {
< PRINTF("%s: not supporting QFRZ option for "
< "target %d\n", isp->isp_name, i);
< }
4435,4438d4622
< if (ISP_NVRAM_TGT_ARQ(nvram_data, i) == 0) {
< PRINTF("%s: not disabling ARQ option for "
< "target %d\n", isp->isp_name, i);
< }
4450,4458d4633
< if (isp->isp_dblev > 2) {
< PRINTF(" Target %d: Enabled %d Throttle %d "
< "Offset %d Period %d Flags 0x%x\n", i,
< sdp->isp_devparam[i].dev_enable,
< sdp->isp_devparam[i].exc_throttle,
< sdp->isp_devparam[i].sync_offset,
< sdp->isp_devparam[i].sync_period,
< sdp->isp_devparam[i].dev_flags);
< }
4468,4469d4642
< static char *tru = "true";
< static char *not = "false";
4513,4540d4685
< if (isp->isp_dblev >= 3) {
< PRINTF("%s: ISP1080 bus %d NVRAM values:\n",
< isp->isp_name, bus);
< PRINTF(" Initiator ID = %d\n",
< sdp->isp_initiator_id);
< PRINTF(" Fifo Threshold = 0x%x\n",
< sdp->isp_fifo_threshold);
< PRINTF(" Bus Reset Delay = %d\n",
< sdp->isp_bus_reset_delay);
< PRINTF(" Retry Count = %d\n",
< sdp->isp_retry_count);
< PRINTF(" Retry Delay = %d\n",
< sdp->isp_retry_delay);
< PRINTF(" Tag Age Limit = %d\n",
< sdp->isp_tag_aging);
< PRINTF(" Selection Timeout = %d\n",
< sdp->isp_selection_timeout);
< PRINTF(" Max Queue Depth = %d\n",
< sdp->isp_max_queue_depth);
< PRINTF(" Async Data Setup = 0x%x\n",
< sdp->isp_async_data_setup);
< PRINTF(" REQ/ACK Active Negation = %s\n",
< sdp->isp_req_ack_active_neg? tru : not);
< PRINTF(" Data Line Active Negation = %s\n",
< sdp->isp_data_line_active_neg? tru : not);
< PRINTF(" Cmd DMA Burst Enable = %s\n",
< sdp->isp_cmd_dma_burst_enable? tru : not);
< }
4553,4557d4697
< if (ISP1080_NVRAM_TGT_QFRZ(nvram_data, i, bus)) {
< PRINTF("%s: not supporting QFRZ option "
< "for target %d bus %d\n",
< isp->isp_name, i, bus);
< }
4559,4563d4698
< if (ISP1080_NVRAM_TGT_ARQ(nvram_data, i, bus) == 0) {
< PRINTF("%s: not disabling ARQ option "
< "for target %d bus %d\n",
< isp->isp_name, i, bus);
< }
4575,4584d4709
< if (isp->isp_dblev >= 3) {
< PRINTF(" Target %d: Ena %d Throttle "
< "%d Offset %d Period %d Flags "
< "0x%x\n", i,
< sdp->isp_devparam[i].dev_enable,
< sdp->isp_devparam[i].exc_throttle,
< sdp->isp_devparam[i].sync_offset,
< sdp->isp_devparam[i].sync_period,
< sdp->isp_devparam[i].dev_flags);
< }
4594,4595d4718
< static char *tru = "true";
< static char *not = "false";
4640,4668d4762
< if (isp->isp_dblev >= 3) {
< PRINTF("%s: ISP12160 bus %d NVRAM values:\n",
< isp->isp_name, bus);
< PRINTF(" Initiator ID = %d\n",
< sdp->isp_initiator_id);
< PRINTF(" Fifo Threshold = 0x%x\n",
< sdp->isp_fifo_threshold);
< PRINTF(" Bus Reset Delay = %d\n",
< sdp->isp_bus_reset_delay);
< PRINTF(" Retry Count = %d\n",
< sdp->isp_retry_count);
< PRINTF(" Retry Delay = %d\n",
< sdp->isp_retry_delay);
< PRINTF(" Tag Age Limit = %d\n",
< sdp->isp_tag_aging);
< PRINTF(" Selection Timeout = %d\n",
< sdp->isp_selection_timeout);
< PRINTF(" Max Queue Depth = %d\n",
< sdp->isp_max_queue_depth);
< PRINTF(" Async Data Setup = 0x%x\n",
< sdp->isp_async_data_setup);
< PRINTF(" REQ/ACK Active Negation = %s\n",
< sdp->isp_req_ack_active_neg? tru : not);
< PRINTF(" Data Line Active Negation = %s\n",
< sdp->isp_data_line_active_neg? tru : not);
< PRINTF(" Cmd DMA Burst Enable = %s\n",
< sdp->isp_cmd_dma_burst_enable? tru : not);
< }
<
4681,4684d4774
< if (ISP12160_NVRAM_TGT_QFRZ(nvram_data, i, bus)) {
< PRINTF("%s: not supporting QFRZ option "
< "for target %d bus %d\n", isp->isp_name, i, bus);
< }
4686,4689d4775
< if (ISP12160_NVRAM_TGT_ARQ(nvram_data, i, bus) == 0) {
< PRINTF("%s: not disabling ARQ option "
< "for target %d bus %d\n", isp->isp_name, i, bus);
< }
4701,4709d4786
< if (isp->isp_dblev >= 3) {
< PRINTF(" Target %d: Ena %d Throttle %d Offset %d "
< "Period %d Flags 0x%x\n", i,
< sdp->isp_devparam[i].dev_enable,
< sdp->isp_devparam[i].exc_throttle,
< sdp->isp_devparam[i].sync_offset,
< sdp->isp_devparam[i].sync_period,
< sdp->isp_devparam[i].dev_flags);
< }
4719,4730c4796
< union {
< struct {
< #if BYTE_ORDER == BIG_ENDIAN
< u_int32_t hi32;
< u_int32_t lo32;
< #else
< u_int32_t lo32;
< u_int32_t hi32;
< #endif
< } wd;
< u_int64_t full64;
< } wwnstore;
---
> u_int64_t wwn;
4735c4801
< * to be used sanely.
---
> * to be used sanely across all cards.
4738,4740c4804,4806
< wwnstore.full64 = ISP2100_NVRAM_PORT_NAME(nvram_data);
< if (wwnstore.full64 != 0LL) {
< switch ((int) (wwnstore.full64 >> 60)) {
---
> wwn = ISP2100_NVRAM_PORT_NAME(nvram_data);
> if (wwn != 0LL) {
> switch ((int) (wwn >> 60)) {
4743,4744c4809
< * Broken cards with nothing in the top nibble.
< * Pah.
---
> * Broken PTI cards with nothing in the top nibble. Pah.
4746c4811
< wwnstore.full64 |= (2LL << 60);
---
> wwn |= (2LL << 60);
4749,4750c4814
< fcp->isp_portwwn = wwnstore.full64;
< fcp->isp_nodewwn = wwnstore.full64;
---
> fcp->isp_nodewwn = wwn;
4752,4755c4816,4817
< if (fcp->isp_nodewwn == fcp->isp_portwwn) {
< fcp->isp_portwwn |=
< (((u_int64_t)(isp->isp_unit+1)) << 48);
< }
---
> fcp->isp_portwwn =
> PORT_FROM_NODE_WWN(isp, fcp->isp_nodewwn);
4758,4759c4820
< fcp->isp_portwwn = wwnstore.full64;
< fcp->isp_nodewwn = wwnstore.full64;
---
> fcp->isp_portwwn = fcp->isp_nodewwn = wwn;
4762,4764c4823,4826
< CFGPRINTF("%s: Node WWN 0x%08x%08x, Port WWN 0x%08x%08x\n",
< isp->isp_name, (u_int32_t) (fcp->isp_nodewwn >> 32),
< (u_int32_t) (fcp->isp_nodewwn & 0xffffffff),
---
> isp_prt(isp, ISP_LOGCONFIG, "NVRAM Derived Node WWN 0x%08x%08x",
> (u_int32_t) (fcp->isp_nodewwn >> 32),
> (u_int32_t) (fcp->isp_nodewwn & 0xffffffff));
> isp_prt(isp, ISP_LOGCONFIG, "NVRAM Derived Port WWN 0x%08x%08x",
4767d4828
<
4781,4799d4841
< if (isp->isp_dblev > 2) {
< PRINTF("%s: NVRAM values:\n", isp->isp_name);
< PRINTF(" Max IOCB Allocation = %d\n",
< fcp->isp_maxalloc);
< PRINTF(" Max Frame Length = %d\n",
< fcp->isp_maxfrmlen);
< PRINTF(" Execution Throttle = %d\n",
< fcp->isp_execthrottle);
< PRINTF(" Retry Count = %d\n",
< fcp->isp_retry_count);
< PRINTF(" Retry Delay = %d\n",
< fcp->isp_retry_delay);
< PRINTF(" Hard Loop ID = %d\n",
< fcp->isp_loopid);
< PRINTF(" Options = 0x%x\n",
< fcp->isp_fwoptions);
< PRINTF(" HBA Options = 0x%x\n",
< ISP2100_NVRAM_HBA_OPTIONS(nvram_data));
< }