summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/ispmbox.h
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2017-05-10 18:59:18 +0000
committerken <ken@FreeBSD.org>2017-05-10 18:59:18 +0000
commit2d43f4c1777c8c0fc380228c4671688bedd4b683 (patch)
tree6bb130744b0b2572ce6f12b839ae9cbbb4863197 /sys/dev/isp/ispmbox.h
parentd0190ee76a8771ad397f83acb9eb3fe1b7c08be8 (diff)
downloadFreeBSD-src-2d43f4c1777c8c0fc380228c4671688bedd4b683.zip
FreeBSD-src-2d43f4c1777c8c0fc380228c4671688bedd4b683.tar.gz
MFC r317740:
Correct loop mode CRN resets to adhere to FCP-4 section 4.10 Prior to this change, the CRN (Command Reference Number) is reset on any firmware LIP, LOOP DOWN, or LOOP RESET event in violation of FCP-4 which specifies that the CRN should only be reset in response to a LIP Reset (LIPyx) primitive. FCP-4 also indicates PLOGI/LOGO and PRLI/PRLO ELS actions as conditions for resetting the CRN for the associated initiator port. These violations manifest themselves when the HBA is removed from the loop, or a target device is removed (especially during an outstanding command) without power cycling. If the HBA and and the target device determine upon re-establishing the loop that no PLOGI or PRLI is required, and the target does not issue a LIPxy to the initiator, the CRN for the target will have been improperly reset by the isp driver. As a result, the target port will silently ignore all FCP commands issued during the device probe (which will time out) preventing the device from attaching. This change corrects thie CRN reset behavior in response to loop state changes, also introduces CRN resets for the above mentioned ELS actions as encountered through async PDB change events. This change also adds cleanup of outstanding commands in isp_loop_dead() that was previously missing. sys/dev/isp/isp.c Add the last login state to debug output when syncing the pdb sys/dev/isp/isp_freebsd.c Replace binary statement setting aborted ccb status in isp_watchdog() with the XS_SETERR macro used elsewhere In isp_loop_dead(), abort or complete pending commands as done in isp_watchdog() In isp_async(), segregate the ISPASYNC_LOOP_RESET action from ISPASYNC_LIP, ISPASYNC_LOOP_DOWN, and ISPASYNC_LOOP_UP fallthroughs, and only reset the CRN in the RESET case. Also add checks to handle false LOOP RESET actions that do not have a proper associated LIP primitive, and log the primitive in the debug messages In isp_async(), remove the goto from ISP_ASYNC_DEV_STAYED, and only reset the CRN in the DEV_CHANGED action In isp_async(), when processing an ISPASYNC_CHANGE_PDB status, reset CRN(s) for the associated nphdl (or all ports) if the change reason is some form of ELS login/logout. Also remove assignment to fc since it is not used in the scope sys/dev/isp/ispmbox.h Add macro definition for the global N-Port handle, and correct a macro typo 'PDB24XX_AE_PRLI_DONJE' sys/dev/isp/ispvar.h Add macros FCP_AL_DA_ALL, FCP_AL_PA, and FCP_IS_DEST_ALPD for more legible code when determining if an AL_PD port matches the portid for a given struct fcparam* by value or by virtue of the AL_PD port being 0xFF Submitted by: Reid Linnemann Sponsored by: Spectra Logic
Diffstat (limited to 'sys/dev/isp/ispmbox.h')
-rw-r--r--sys/dev/isp/ispmbox.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/isp/ispmbox.h b/sys/dev/isp/ispmbox.h
index f672b42..e747c55 100644
--- a/sys/dev/isp/ispmbox.h
+++ b/sys/dev/isp/ispmbox.h
@@ -1421,6 +1421,10 @@ typedef struct {
/*
* Port Database Changed Async Event information for 24XX cards
*/
+/* N-Port Handle */
+#define PDB24XX_AE_GLOBAL 0xFFFF
+
+/* Reason Codes */
#define PDB24XX_AE_OK 0x00
#define PDB24XX_AE_IMPL_LOGO_1 0x01
#define PDB24XX_AE_IMPL_LOGO_2 0x02
@@ -1440,7 +1444,7 @@ typedef struct {
#define PDB24XX_AE_FLOGI_TIMO 0x10
#define PDB24XX_AE_ABX_LOGO 0x11
#define PDB24XX_AE_PLOGI_DONE 0x12
-#define PDB24XX_AE_PRLI_DONJE 0x13
+#define PDB24XX_AE_PRLI_DONE 0x13
#define PDB24XX_AE_OPN_1 0x14
#define PDB24XX_AE_OPN_2 0x15
#define PDB24XX_AE_TXERR 0x16
OpenPOWER on IntegriCloud