Date: Tue, 3 May 2016 08:03:51 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298969 - stable/10/sys/dev/isp Message-ID: <201605030803.u4383pG8044882@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue May 3 08:03:51 2016 New Revision: 298969 URL: https://svnweb.freebsd.org/changeset/base/298969 Log: MFC r297912: Respect NVRAM topology settings on 24xx and above chips. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue May 3 08:03:07 2016 (r298968) +++ stable/10/sys/dev/isp/isp.c Tue May 3 08:03:51 2016 (r298969) @@ -1822,22 +1822,24 @@ isp_fibre_init(ispsoftc_t *isp) * Prefer or force Point-To-Point instead Loop? */ switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { - case ISP_CFG_NPORT: + case ISP_CFG_LPORT_ONLY: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; - icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP; + icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY; break; case ISP_CFG_NPORT_ONLY: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; icbp->icb_xfwoptions |= ICBXOPT_PTP_ONLY; break; - case ISP_CFG_LPORT_ONLY: + case ISP_CFG_LPORT: icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; - icbp->icb_xfwoptions |= ICBXOPT_LOOP_ONLY; + icbp->icb_xfwoptions |= ICBXOPT_LOOP_2_PTP; + break; + case ISP_CFG_NPORT: + icbp->icb_xfwoptions &= ~ICBXOPT_TOPO_MASK; + icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP; break; default: - /* - * Let NVRAM settings define it if they are sane - */ + /* Let NVRAM settings define it if they are sane */ switch (icbp->icb_xfwoptions & ICBXOPT_TOPO_MASK) { case ICBXOPT_PTP_2_LOOP: case ICBXOPT_PTP_ONLY: @@ -2109,19 +2111,32 @@ isp_fibre_init_2400(ispsoftc_t *isp) } switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { - case ISP_CFG_NPORT_ONLY: - icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; - icbp->icb_fwoptions2 |= ICB2400_OPT2_PTP_ONLY; - break; case ISP_CFG_LPORT_ONLY: icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_ONLY; break; - default: + case ISP_CFG_NPORT_ONLY: + icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; + icbp->icb_fwoptions2 |= ICB2400_OPT2_PTP_ONLY; + break; + case ISP_CFG_NPORT: /* ISP_CFG_PTP_2_LOOP not available in 24XX/25XX */ + case ISP_CFG_LPORT: icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_2_PTP; break; + default: + /* Let NVRAM settings define it if they are sane */ + switch (icbp->icb_fwoptions2 & ICB2400_OPT2_TOPO_MASK) { + case ICB2400_OPT2_LOOP_ONLY: + case ICB2400_OPT2_PTP_ONLY: + case ICB2400_OPT2_LOOP_2_PTP: + break; + default: + icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; + icbp->icb_fwoptions2 |= ICB2400_OPT2_LOOP_2_PTP; + } + break; } switch (icbp->icb_fwoptions2 & ICB2400_OPT2_TIMER_MASK) { @@ -7807,23 +7822,23 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c if (IS_24XX(isp)) { fcp->isp_fwoptions |= ICB2400_OPT1_FAIRNESS; fcp->isp_fwoptions |= ICB2400_OPT1_HARD_ADDRESS; - if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { + if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) fcp->isp_fwoptions |= ICB2400_OPT1_FULL_DUPLEX; - } fcp->isp_fwoptions |= ICB2400_OPT1_BOTH_WWNS; + fcp->isp_xfwoptions |= ICB2400_OPT2_LOOP_2_PTP; fcp->isp_zfwoptions |= ICB2400_OPT3_RATE_AUTO; } else { fcp->isp_fwoptions |= ICBOPT_FAIRNESS; fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE; fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS; - if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { + if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) fcp->isp_fwoptions |= ICBOPT_FULL_DUPLEX; - } /* * Make sure this is turned off now until we get * extended options from NVRAM */ fcp->isp_fwoptions &= ~ICBOPT_EXTENDED; + fcp->isp_xfwoptions |= ICBXOPT_LOOP_2_PTP; fcp->isp_zfwoptions |= ICBZOPT_RATE_AUTO; } Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:07 2016 (r298968) +++ stable/10/sys/dev/isp/ispvar.h Tue May 3 08:03:51 2016 (r298969) @@ -645,11 +645,12 @@ struct ispsoftc { * ISP Runtime Configuration Options */ #define ISP_CFG_FULL_DUPLEX 0x01 /* Full Duplex (Fibre Channel only) */ -#define ISP_CFG_PORT_PREF 0x0c /* Mask for Port Prefs (all FC except 2100) */ -#define ISP_CFG_LPORT 0x00 /* prefer {N/F}L-Port connection */ -#define ISP_CFG_NPORT 0x04 /* prefer {N/F}-Port connection */ -#define ISP_CFG_NPORT_ONLY 0x08 /* insist on {N/F}-Port connection */ -#define ISP_CFG_LPORT_ONLY 0x0c /* insist on {N/F}L-Port connection */ +#define ISP_CFG_PORT_PREF 0x0e /* Mask for Port Prefs (all FC except 2100) */ +#define ISP_CFG_PORT_DEF 0x00 /* prefer connection type from NVRAM */ +#define ISP_CFG_LPORT_ONLY 0x02 /* insist on {N/F}L-Port connection */ +#define ISP_CFG_NPORT_ONLY 0x04 /* insist on {N/F}-Port connection */ +#define ISP_CFG_LPORT 0x06 /* prefer {N/F}L-Port connection */ +#define ISP_CFG_NPORT 0x08 /* prefer {N/F}-Port connection */ #define ISP_CFG_1GB 0x10 /* force 1GB connection (23XX only) */ #define ISP_CFG_2GB 0x20 /* force 2GB connection (23XX only) */ #define ISP_CFG_NORELOAD 0x80 /* don't download f/w */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605030803.u4383pG8044882>