diff options
author | mav <mav@FreeBSD.org> | 2015-11-23 15:49:50 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-11-23 15:49:50 +0000 |
commit | baa220781ba9f11e24dd5e85731fb77c7bbe4869 (patch) | |
tree | 2dfb4ecef9c249189342540f21a5a65642a94aa1 | |
parent | 7f6c6181f2daab85e5eda752b8c8e8fa450a74ee (diff) | |
download | FreeBSD-src-baa220781ba9f11e24dd5e85731fb77c7bbe4869.zip FreeBSD-src-baa220781ba9f11e24dd5e85731fb77c7bbe4869.tar.gz |
Fix target mode support for Qlogic 2200 FC adapters.
Now target mode works for all supported FC adapters except ancient 2100,
which is not tested.
-rw-r--r-- | share/man/man4/isp.4 | 28 | ||||
-rw-r--r-- | sys/dev/isp/isp.c | 14 | ||||
-rw-r--r-- | sys/dev/isp/isp_freebsd.c | 2 | ||||
-rw-r--r-- | sys/dev/isp/isp_library.c | 6 | ||||
-rw-r--r-- | sys/dev/isp/isp_pci.c | 6 | ||||
-rw-r--r-- | sys/dev/isp/ispmbox.h | 4 |
6 files changed, 30 insertions, 30 deletions
diff --git a/share/man/man4/isp.4 b/share/man/man4/isp.4 index aa59599..7a39d92 100644 --- a/share/man/man4/isp.4 +++ b/share/man/man4/isp.4 @@ -1,7 +1,6 @@ -.\" $NetBSD: isp.4,v 1.5 1999/12/18 18:33:05 mjacob Exp $ -.\" -.\" Copyright (c) 1998, 1999, 2001 -.\" Matthew Jacob, for NASA/Ames Research Center +.\" Copyright (c) 2009-2015 Alexander Motin <mav@FreeBSD.org> +.\" Copyright (c) 2006 Marcus Alves Grando +.\" Copyright (c) 1998-2001 Matthew Jacob, for NASA/Ames Research Center .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -25,8 +24,6 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" Additional Copyright (c) 2006 by Marcus Alves Grando -.\" .\" $FreeBSD$ .\" .Dd November 22, 2015 @@ -34,7 +31,7 @@ .Os .Sh NAME .Nm isp -.Nd Qlogic based SCSI and FibreChannel SCSI Host Adapters +.Nd Qlogic based SPI and FibreChannel SCSI Host Adapters .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,23 +49,19 @@ isp_load="YES" .Ed .Sh DESCRIPTION This driver provides access to -.Tn SCSI +.Tn SPI or .Tn FibreChannel -devices. +SCSI devices. .Pp -SCSI features include support for Ultra SCSI and wide mode transactions -for +SPI supports initiator mode for Ultra SCSI and wide mode transactions for .Tn SCSI , Ultra2 LVD (1080, 1280), and Ultra3 LVD (10160, 12160). .Pp -Fibre Channel support uses FCP SCSI profile for -.Tn FibreChannel , -and utilizes Class 3 and Class 2 (2200 and later) connections. +Fibre Channel supports initiator and target modes of FCP SCSI profile, +utilizing Class 3 and Class 2 (2200 and later) connections. Support is available for Public and Private loops, Point-to-Point and Fabric connections. -The newer 2-Gigabit cards (2300, 2312, 2322), 4-Gigabit (2422, 2432) -and 8-Gigabit (2532) are supported in both initiator and target modes. .Sh FIRMWARE Firmware loading is supported if the .Xr ispfw 4 @@ -120,8 +113,7 @@ Optical 4Gb Fibre Channel PCIe cards. Optical 8Gb Fibre Channel PCIe cards. .El .Sh CONFIGURATION OPTIONS -Target mode support for 23xx and above Fibre Channel adapters may be -enabled with the +Target mode support for Fibre Channel adapters may be enabled with the .Pp .Cd options ISP_TARGET_MODE .Pp diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c index e9cccb1..04ef001 100644 --- a/sys/dev/isp/isp.c +++ b/sys/dev/isp/isp.c @@ -1733,7 +1733,12 @@ isp_fibre_init(ispsoftc_t *isp) icbp->icb_fwoptions &= ~ICBOPT_TGT_ENABLE; } - if (fcp->role & ISP_ROLE_INITIATOR) { + /* + * For some reason my 2200 does not generate ATIOs in target mode + * if initiator is disabled. Extra logins are better then target + * not working at all. + */ + if ((fcp->role & ISP_ROLE_INITIATOR) || IS_2100(isp) || IS_2200(isp)) { icbp->icb_fwoptions &= ~ICBOPT_INI_DISABLE; } else { icbp->icb_fwoptions |= ICBOPT_INI_DISABLE; @@ -1954,6 +1959,8 @@ isp_fibre_init(ispsoftc_t *isp) } isp_prt(isp, ISP_LOGDEBUG0, "isp_fibre_init: fwopt 0x%x xfwopt 0x%x zfwopt 0x%x", icbp->icb_fwoptions, icbp->icb_xfwoptions, icbp->icb_zfwoptions); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "isp_fibre_init", sizeof (*icbp), icbp); isp_put_icb(isp, icbp, (isp_icb_t *)fcp->isp_scratch); @@ -1966,17 +1973,14 @@ isp_fibre_init(ispsoftc_t *isp) mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); mbs.param[7] = DMA_WD2(fcp->isp_scdma); - mbs.logval = MBLOGALL; isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %p (%08x%08x)", fcp->isp_scratch, (uint32_t) ((uint64_t)fcp->isp_scdma >> 32), (uint32_t) fcp->isp_scdma); MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0); isp_mboxcmd(isp, &mbs); FC_SCRATCH_RELEASE(isp, 0); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - isp_print_bytes(isp, "isp_fibre_init", sizeof (*icbp), icbp); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) return; - } isp->isp_reqidx = 0; isp->isp_reqodx = 0; isp->isp_residx = 0; diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index 5ac8ef4..5d4c116 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -4947,7 +4947,7 @@ isp_fcp_next_crn(ispsoftc_t *isp, uint8_t *crnp, XS_T *cmd) struct isp_nexus *nxp; int idx; - if (isp->isp_type < ISP_HA_FC_2300) + if (IS_2100(isp)) return (0); chan = XS_CHANNEL(cmd); diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c index a51f1ce..6003d00 100644 --- a/sys/dev/isp/isp_library.c +++ b/sys/dev/isp/isp_library.c @@ -963,7 +963,8 @@ isp_put_request_t2(ispsoftc_t *isp, ispreqt2_t *src, ispreqt2_t *dst) ISP_IOXPUT_8(isp, src->req_target, &dst->req_target); ISP_IOXPUT_16(isp, src->req_scclun, &dst->req_scclun); ISP_IOXPUT_16(isp, src->req_flags, &dst->req_flags); - ISP_IOXPUT_16(isp, src->req_reserved, &dst->req_reserved); + ISP_IOXPUT_8(isp, src->req_crn, &dst->req_crn); + ISP_IOXPUT_8(isp, src->req_reserved, &dst->req_reserved); ISP_IOXPUT_16(isp, src->req_time, &dst->req_time); ISP_IOXPUT_16(isp, src->req_seg_count, &dst->req_seg_count); for (i = 0; i < ASIZE(src->req_cdb); i++) { @@ -985,7 +986,8 @@ isp_put_request_t2e(ispsoftc_t *isp, ispreqt2e_t *src, ispreqt2e_t *dst) ISP_IOXPUT_16(isp, src->req_target, &dst->req_target); ISP_IOXPUT_16(isp, src->req_scclun, &dst->req_scclun); ISP_IOXPUT_16(isp, src->req_flags, &dst->req_flags); - ISP_IOXPUT_16(isp, src->req_reserved, &dst->req_reserved); + ISP_IOXPUT_8(isp, src->req_crn, &dst->req_crn); + ISP_IOXPUT_8(isp, src->req_reserved, &dst->req_reserved); ISP_IOXPUT_16(isp, src->req_time, &dst->req_time); ISP_IOXPUT_16(isp, src->req_seg_count, &dst->req_seg_count); for (i = 0; i < ASIZE(src->req_cdb); i++) { diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c index 4cbaaa8..1f3d6d6 100644 --- a/sys/dev/isp/isp_pci.c +++ b/sys/dev/isp/isp_pci.c @@ -1488,7 +1488,7 @@ imc(void *arg, bus_dma_segment_t *segs, int nseg, int error) segs->ds_addr += ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(imushp->isp)); imushp->vbase += ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(imushp->isp)); - if (imushp->isp->isp_type >= ISP_HA_FC_2300) { + if (imushp->isp->isp_type >= ISP_HA_FC_2200) { imushp->isp->isp_osinfo.ecmd_dma = segs->ds_addr; imushp->isp->isp_osinfo.ecmd_free = (isp_ecmd_t *)imushp->vbase; imushp->isp->isp_osinfo.ecmd_base = imushp->isp->isp_osinfo.ecmd_free; @@ -1627,7 +1627,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) len += ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)); } #endif - if (isp->isp_type >= ISP_HA_FC_2300) { + if (isp->isp_type >= ISP_HA_FC_2200) { len += (N_XCMDS * XCMD_SIZE); } @@ -1689,7 +1689,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) bus_dma_tag_destroy(fc->tdmat); goto bad; } - if (isp->isp_type >= ISP_HA_FC_2300) { + if (!IS_2100(isp)) { for (i = 0; i < INITIAL_NEXUS_COUNT; i++) { struct isp_nexus *n = malloc(sizeof (struct isp_nexus), M_DEVBUF, M_NOWAIT | M_ZERO); if (n == NULL) { diff --git a/sys/dev/isp/ispmbox.h b/sys/dev/isp/ispmbox.h index cc06449..2978b0c 100644 --- a/sys/dev/isp/ispmbox.h +++ b/sys/dev/isp/ispmbox.h @@ -481,7 +481,8 @@ typedef struct { uint16_t req_target; uint16_t req_scclun; uint16_t req_flags; - uint16_t req_reserved; + uint8_t req_crn; + uint8_t req_reserved; uint16_t req_time; uint16_t req_seg_count; uint8_t req_cdb[16]; @@ -1010,6 +1011,7 @@ typedef struct { #define ICBZOPT_RATE_AUTO 0x8000 #define ICBZOPT_RATE_TWOGB 0x4000 #define ICBZOPT_50_OHM 0x2000 +#define ICBZOPT_NO_LOCAL_PLOGI 0x0080 #define ICBZOPT_ENA_OOF 0x0040 /* out of order frame handling */ #define ICBZOPT_RSPSZ_MASK 0x0030 #define ICBZOPT_RSPSZ_24 0x0000 |