diff --git a/qla_isp/common/isp.c b/qla_isp/common/isp.c index ba7e2b66e..a66e95772 100644 --- a/qla_isp/common/isp.c +++ b/qla_isp/common/isp.c @@ -1,4 +1,4 @@ -/* $Id: isp.c,v 1.219 2009/05/10 16:25:09 mjacob Exp $ */ +/* $Id: isp.c,v 1.224 2009/09/06 00:38:03 mjacob Exp $ */ /*- * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. @@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD$"); #endif #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: head/sys/dev/isp/isp.c 196008 2009-08-01 01:04:26Z mjacob $"); #include #endif #ifdef __OpenBSD__ @@ -1574,24 +1574,18 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_maxfrmlen = DEFAULT_FRAMESIZE(isp); - if (icbp->icb_maxfrmlen < ICB_MIN_FRMLEN || - icbp->icb_maxfrmlen > ICB_MAX_FRMLEN) { - isp_prt(isp, ISP_LOGERR, - "bad frame length (%d) from NVRAM- using %d", - DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN); + if (icbp->icb_maxfrmlen < ICB_MIN_FRMLEN || icbp->icb_maxfrmlen > ICB_MAX_FRMLEN) { + isp_prt(isp, ISP_LOGERR, "bad frame length (%d) from NVRAM- using %d", DEFAULT_FRAMESIZE(isp), ICB_DFLT_FRMLEN); icbp->icb_maxfrmlen = ICB_DFLT_FRMLEN; } icbp->icb_maxalloc = fcp->isp_maxalloc; if (icbp->icb_maxalloc < 1) { - isp_prt(isp, ISP_LOGERR, - "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc); + isp_prt(isp, ISP_LOGERR, "bad maximum allocation (%d)- using 16", fcp->isp_maxalloc); icbp->icb_maxalloc = 16; } icbp->icb_execthrottle = DEFAULT_EXEC_THROTTLE(isp); if (icbp->icb_execthrottle < 1) { - isp_prt(isp, ISP_LOGERR, - "bad execution throttle of %d- using %d", - DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); + isp_prt(isp, ISP_LOGERR, "bad execution throttle of %d- using %d", DEFAULT_EXEC_THROTTLE(isp), ICB_DFLT_THROTTLE); icbp->icb_execthrottle = ICB_DFLT_THROTTLE; } icbp->icb_retry_delay = fcp->isp_retry_delay; @@ -1685,18 +1679,18 @@ isp_fibre_init(ispsoftc_t *isp) /* * For 22XX > 2.1.26 && 23XX, set some options. - * XXX: Probably okay for newer 2100 f/w too. */ if (ISP_FW_NEWER_THAN(isp, 2, 26, 0)) { - /* - * Turn on LIP F8 async event (1) - * Turn on generate AE 8013 on all LIP Resets (2) - * Disable LIP F7 switching (8) - */ MBSINIT(&mbs, MBOX_SET_FIRMWARE_OPTIONS, MBLOGALL, 0); - mbs.param[1] = 0xb; + mbs.param[1] = IFCOPT1_DISF7SWTCH|IFCOPT1_LIPASYNC|IFCOPT1_LIPF8; mbs.param[2] = 0; mbs.param[3] = 0; + if (ISP_FW_NEWER_THAN(isp, 3, 16, 0)) { + mbs.param[1] |= IFCOPT1_EQFQASYNC|IFCOPT1_CTIO_RETRY; + if (fcp->role & ISP_ROLE_TARGET) { + mbs.param[3] = IFCOPT3_NOPRLI; + } + } isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { return; @@ -2120,8 +2114,7 @@ isp_mark_portdb(ispsoftc_t *isp, int chan, int disposition) * or via FABRIC LOGIN/FABRIC LOGOUT for other cards. */ static int -isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, - int flags, int gs) +isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags, int gs) { mbreg_t mbs; uint8_t q[QENTRY_LEN]; diff --git a/qla_isp/common/isp_library.c b/qla_isp/common/isp_library.c index 71d685b90..256cdda41 100644 --- a/qla_isp/common/isp_library.c +++ b/qla_isp/common/isp_library.c @@ -1,4 +1,4 @@ -/* $Id: isp_library.c,v 1.61 2009/05/10 16:25:09 mjacob Exp $ */ +/* $Id: isp_library.c,v 1.63 2009/08/08 19:46:31 mjacob Exp $ */ /*- * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. @@ -62,7 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD$"); #endif #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: head/sys/dev/isp/isp_library.c 196008 2009-08-01 01:04:26Z mjacob $"); #include #endif #ifdef __OpenBSD__ diff --git a/qla_isp/common/isp_target.c b/qla_isp/common/isp_target.c index 0fb0c8d04..fe8966d0a 100644 --- a/qla_isp/common/isp_target.c +++ b/qla_isp/common/isp_target.c @@ -1,4 +1,4 @@ -/* $Id: isp_target.c,v 1.87 2009/05/01 22:34:13 mjacob Exp $ */ +/* $Id: isp_target.c,v 1.88 2009/08/08 19:46:31 mjacob Exp $ */ /*- * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. @@ -68,7 +68,7 @@ #endif #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD:$"); +__FBSDID("$FreeBSD: head/sys/dev/isp/isp_target.c 196008 2009-08-01 01:04:26Z mjacob $"); #include #endif #ifdef __OpenBSD__ diff --git a/qla_isp/common/ispmbox.h b/qla_isp/common/ispmbox.h index 64e342704..9e1a829dd 100644 --- a/qla_isp/common/ispmbox.h +++ b/qla_isp/common/ispmbox.h @@ -1,4 +1,4 @@ -/* $Id: ispmbox.h,v 1.79 2009/05/01 22:34:13 mjacob Exp $ */ +/* $Id: ispmbox.h,v 1.80 2009/09/06 00:38:03 mjacob Exp $ */ /*- * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. @@ -270,12 +270,38 @@ #define ASYNC_RIO_COMP 0x8042 #define ASYNC_RCV_ERR 0x8048 +/* + * Firmware Options. There are a lot of them. + * + * IFCOPTN - ISP Fibre Channel Option Word N + */ +#define IFCOPT1_EQFQASYNC (1 << 13) /* enable QFULL notification */ +#define IFCOPT1_EAABSRCVD (1 << 12) +#define IFCOPT1_RJTASYNC (1 << 11) /* enable 8018 notification */ +#define IFCOPT1_ENAPURE (1 << 10) +#define IFCOPT1_ENA8017 (1 << 7) +#define IFCOPT1_DISGPIO67 (1 << 6) +#define IFCOPT1_LIPLOSSIMM (1 << 5) +#define IFCOPT1_DISF7SWTCH (1 << 4) +#define IFCOPT1_CTIO_RETRY (1 << 3) +#define IFCOPT1_LIPASYNC (1 << 1) +#define IFCOPT1_LIPF8 (1 << 0) + +#define IFCOPT2_LOOPBACK (1 << 1) +#define IFCOPT2_ATIO3_ONLY (1 << 0) + +#define IFCOPT3_NOPRLI (1 << 4) /* disable automatic sending of PRLI on local loops */ +#define IFCOPT3_RNDASYNC (1 << 1) /* * 2.01.31 2200 Only. Need Bit 13 in Mailbox 1 for Set Firmware Options * mailbox command to enable this. */ #define ASYNC_QFULL_SENT 0x8049 +/* + * Needs to be enabled + */ +#define ASYNC_AUTO_PLOGI_RJT 0x8018 /* * 24XX only */ diff --git a/qla_isp/common/ispvar.h b/qla_isp/common/ispvar.h index 8db5ee6fd..008e6ded9 100644 --- a/qla_isp/common/ispvar.h +++ b/qla_isp/common/ispvar.h @@ -1,4 +1,4 @@ -/* $Id: ispvar.h,v 1.109 2009/05/10 16:25:09 mjacob Exp $ */ +/* $Id: ispvar.h,v 1.111 2009/06/07 04:35:31 mjacob Exp $ */ /*- * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved.