From owner-svn-src-all@freebsd.org Fri Nov 13 19:41:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B05BA2E779; Fri, 13 Nov 2015 19:41:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8C1D1BCE; Fri, 13 Nov 2015 19:41:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tADJf4oC094756; Fri, 13 Nov 2015 19:41:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tADJf4QK094754; Fri, 13 Nov 2015 19:41:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511131941.tADJf4QK094754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 13 Nov 2015 19:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290784 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2015 19:41:06 -0000 Author: mav Date: Fri Nov 13 19:41:04 2015 New Revision: 290784 URL: https://svnweb.freebsd.org/changeset/base/290784 Log: MFC r289681: Some more defines and polishing for INIT_FIRMWARE. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispmbox.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Fri Nov 13 19:39:36 2015 (r290783) +++ stable/10/sys/dev/isp/isp.c Fri Nov 13 19:41:04 2015 (r290784) @@ -2075,10 +2075,11 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_fwoptions2 |= ICB2400_OPT2_FCTAPE; } - if (icbp->icb_fwoptions2 & ICB2400_OPT2_FCTAPE) { - FCPARAM(isp, chan)->fctape_enabled = 1; - } else { - FCPARAM(isp, chan)->fctape_enabled = 0; + for (chan = 0; chan < isp->isp_nchan; chan++) { + if (icbp->icb_fwoptions2 & ICB2400_OPT2_FCTAPE) + FCPARAM(isp, chan)->fctape_enabled = 1; + else + FCPARAM(isp, chan)->fctape_enabled = 0; } switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { @@ -2209,31 +2210,39 @@ isp_fibre_init_2400(ispsoftc_t *isp) size_t amt = 0; uint8_t *off; - vpinfo.vp_count = isp->isp_nchan - 1; vpinfo.vp_global_options = 0; + if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) { + vpinfo.vp_global_options |= ICB2400_VPGOPT_VP0_DECOUPLE; + vpinfo.vp_count = isp->isp_nchan; + chan = 0; + } else { + vpinfo.vp_count = isp->isp_nchan - 1; + chan = 1; + } off = fcp->isp_scratch; off += ICB2400_VPINFO_OFF; vdst = (isp_icb_2400_vpinfo_t *) off; isp_put_icb_2400_vpinfo(isp, &vpinfo, vdst); amt = ICB2400_VPINFO_OFF + sizeof (isp_icb_2400_vpinfo_t); - for (chan = 1; chan < isp->isp_nchan; chan++) { + for (; chan < isp->isp_nchan; chan++) { fcparam *fcp2; ISP_MEMZERO(&pi, sizeof (pi)); fcp2 = FCPARAM(isp, chan); if (fcp2->role != ISP_ROLE_NONE) { pi.vp_port_options = ICB2400_VPOPT_ENABLED; - if (fcp2->role & ISP_ROLE_INITIATOR) { + if (fcp2->role & ISP_ROLE_INITIATOR) pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE; - } - if ((fcp2->role & ISP_ROLE_TARGET) == 0) { + if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; - } - MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); - MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); } + MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); + MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; - off += ICB2400_VPINFO_PORT_OFF(chan); + if (isp->isp_fwattr & ISP2400_FW_ATTR_VP0) + off += ICB2400_VPINFO_PORT_OFF(chan); + else + off += ICB2400_VPINFO_PORT_OFF(chan - 1); pdst = (vp_port_info_t *) off; isp_put_vp_port_info(isp, &pi, pdst); amt += ICB2400_VPOPT_WRITE_SIZE; Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:39:36 2015 (r290783) +++ stable/10/sys/dev/isp/ispmbox.h Fri Nov 13 19:41:04 2015 (r290784) @@ -989,6 +989,13 @@ typedef struct { #define ICB2400_OPT1_FAIRNESS 0x00000002 #define ICB2400_OPT1_HARD_ADDRESS 0x00000001 +#define ICB2400_OPT2_ENA_ATIOMQ 0x08000000 +#define ICB2400_OPT2_ENA_IHA 0x04000000 +#define ICB2400_OPT2_QOS 0x02000000 +#define ICB2400_OPT2_IOCBS 0x01000000 +#define ICB2400_OPT2_ENA_IHR 0x00400000 +#define ICB2400_OPT2_ENA_VMS 0x00200000 +#define ICB2400_OPT2_ENA_TA 0x00100000 #define ICB2400_OPT2_TPRLIC 0x00004000 #define ICB2400_OPT2_FCTAPE 0x00001000 #define ICB2400_OPT2_FCSP 0x00000800 @@ -1003,14 +1010,20 @@ typedef struct { #define ICB2400_OPT2_ZIO 0x00000005 #define ICB2400_OPT2_ZIO1 0x00000006 -#define ICB2400_OPT3_75_OHM 0x00010000 +#define ICB2400_OPT3_NO_CTXDIS 0x40000000 +#define ICB2400_OPT3_ENA_ETH_RESP 0x08000000 +#define ICB2400_OPT3_ENA_ETH_ATIO 0x04000000 +#define ICB2400_OPT3_ENA_MFCF 0x00020000 +#define ICB2400_OPT3_SKIP_FOURGB 0x00010000 #define ICB2400_OPT3_RATE_MASK 0x0000E000 #define ICB2400_OPT3_RATE_ONEGB 0x00000000 #define ICB2400_OPT3_RATE_TWOGB 0x00002000 -#define ICB2400_OPT3_RATE_AUTO 0x00004000 +#define ICB2400_OPT3_RATE_AUTO 0x00004000 #define ICB2400_OPT3_RATE_FOURGB 0x00006000 #define ICB2400_OPT3_RATE_EIGHTGB 0x00008000 +#define ICB2400_OPT3_RATE_SIXTEENGB 0x0000A000 #define ICB2400_OPT3_ENA_OOF_XFRDY 0x00000200 +#define ICB2400_OPT3_NO_N2N_LOGI 0x00000100 #define ICB2400_OPT3_NO_LOCAL_PLOGI 0x00000080 #define ICB2400_OPT3_ENA_OOF 0x00000040 /* note that a response size flag of zero is reserved! */ @@ -1124,12 +1137,13 @@ typedef struct { uint16_t vp_port_portid_hi; /* not present when trailing icb */ } vp_port_info_t; -#define ICB2400_VPOPT_TGT_DISABLE 0x00000020 /* disable target mode */ -#define ICB2400_VPOPT_INI_ENABLE 0x00000010 /* enable initiator mode */ -#define ICB2400_VPOPT_ENABLED 0x00000008 -#define ICB2400_VPOPT_NOPLAY 0x00000004 -#define ICB2400_VPOPT_PREVLOOP 0x00000002 -#define ICB2400_VPOPT_HARD_ADDRESS 0x00000001 +#define ICB2400_VPOPT_ENA_SNSLOGIN 0x00000040 /* Enable SNS Login and SCR for Virtual Ports */ +#define ICB2400_VPOPT_TGT_DISABLE 0x00000020 /* Target Mode Disabled */ +#define ICB2400_VPOPT_INI_ENABLE 0x00000010 /* Initiator Mode Enabled */ +#define ICB2400_VPOPT_ENABLED 0x00000008 /* VP Enabled */ +#define ICB2400_VPOPT_NOPLAY 0x00000004 /* ID Not Acquired */ +#define ICB2400_VPOPT_PREVLOOP 0x00000002 /* Previously Assigned ID */ +#define ICB2400_VPOPT_HARD_ADDRESS 0x00000001 /* Hard Assigned ID */ #define ICB2400_VPOPT_WRITE_SIZE 20 @@ -1145,12 +1159,14 @@ typedef struct { #define ICB2400_VPINFO_OFF 0x80 /* offset from start of ICB */ #define ICB2400_VPINFO_PORT_OFF(chan) \ - ICB2400_VPINFO_OFF + \ - sizeof (isp_icb_2400_vpinfo_t) + ((chan - 1) * ICB2400_VPOPT_WRITE_SIZE) + (ICB2400_VPINFO_OFF + \ + sizeof (isp_icb_2400_vpinfo_t) + (chan * ICB2400_VPOPT_WRITE_SIZE)) #define ICB2400_VPGOPT_FCA 0x01 /* Assume Clean Address bit in FLOGI ACC set (works only in static configurations) */ #define ICB2400_VPGOPT_MID_DISABLE 0x02 /* when set, connection mode2 will work with NPIV-capable switched */ #define ICB2400_VPGOPT_VP0_DECOUPLE 0x04 /* Allow VP0 decoupling if firmware supports it */ +#define ICB2400_VPGOPT_SUSP_FDISK 0x10 /* Suspend FDISC for Enabled VPs */ +#define ICB2400_VPGOPT_GEN_RIDA 0x20 /* Generate RIDA if FLOGI Fails */ typedef struct { isphdr_t vp_ctrl_hdr; @@ -1197,8 +1213,10 @@ typedef struct { #define VP_IDX_ERR 0x04 #define VP_STS_BSY 0x05 -#define VP_MODIFY_VP 0x00 +#define VP_MODIFY 0x00 #define VP_MODIFY_ENA 0x01 +#define VP_MODIFY_OPT 0x02 +#define VP_RESUME 0x03 /* * Port Data Base Element