Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Nov 2015 21:35:03 +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: r291507 - stable/10/sys/dev/isp
Message-ID:  <201511302135.tAULZ3oR069888@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Nov 30 21:35:03 2015
New Revision: 291507
URL: https://svnweb.freebsd.org/changeset/base/291507

Log:
  MFC r290978: Add real initial support for RQSTYPE_RPT_ID_ACQ.

Modified:
  stable/10/sys/dev/isp/isp.c
  stable/10/sys/dev/isp/isp_library.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	Mon Nov 30 21:34:17 2015	(r291506)
+++ stable/10/sys/dev/isp/isp.c	Mon Nov 30 21:35:03 2015	(r291507)
@@ -6192,6 +6192,9 @@ isp_parse_async_fc(ispsoftc_t *isp, uint
 static int
 isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *optrp)
 {
+	isp_ridacq_t rid;
+	int chan, c;
+
 	switch (type) {
 	case RQSTYPE_STATUS_CONT:
 		isp_prt(isp, ISP_LOG_WARN1, "Ignored Continuation Response");
@@ -6199,6 +6202,23 @@ isp_handle_other_response(ispsoftc_t *is
 	case RQSTYPE_MARKER:
 		isp_prt(isp, ISP_LOG_WARN1, "Marker Response");
 		return (1);
+	case RQSTYPE_RPT_ID_ACQ:
+		isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid);
+		if (rid.ridacq_format == 0) {
+			for (chan = 0; chan < isp->isp_nchan; chan++) {
+				fcparam *fcp = FCPARAM(isp, chan);
+				if (fcp->role == ISP_ROLE_NONE)
+					continue;
+				c = (chan == 0) ? 127 : (chan - 1);
+				if (rid.ridacq_map[c / 16] & (1 << (c % 16)))
+					isp_async(isp, ISPASYNC_CHANGE_NOTIFY,
+					    chan, ISPASYNC_CHANGE_OTHER);
+			}
+		} else {
+			isp_async(isp, ISPASYNC_CHANGE_NOTIFY,
+			    rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER);
+		}
+		return (1);
 	case RQSTYPE_ATIO:
 	case RQSTYPE_CTIO:
 	case RQSTYPE_ENABLE_LUN:
@@ -6219,15 +6239,6 @@ isp_handle_other_response(ispsoftc_t *is
 		}
 #endif
 		/* FALLTHROUGH */
-	case RQSTYPE_RPT_ID_ACQ:
-		if (IS_24XX(isp)) {
-			isp_ridacq_t rid;
-			isp_get_ridacq(isp, (isp_ridacq_t *)hp, &rid);
-			if (rid.ridacq_format == 0) {
-			}
-			return (1);
-		}
-		/* FALLTHROUGH */
 	case RQSTYPE_REQUEST:
 	default:
 		ISP_DELAY(100);

Modified: stable/10/sys/dev/isp/isp_library.c
==============================================================================
--- stable/10/sys/dev/isp/isp_library.c	Mon Nov 30 21:34:17 2015	(r291506)
+++ stable/10/sys/dev/isp/isp_library.c	Mon Nov 30 21:35:03 2015	(r291507)
@@ -1733,6 +1733,10 @@ isp_get_ridacq(ispsoftc_t *isp, isp_rida
 	int i;
 	isp_get_hdr(isp, &src->ridacq_hdr, &dst->ridacq_hdr);
 	ISP_IOXGET_32(isp, &src->ridacq_handle, dst->ridacq_handle);
+	ISP_IOXGET_8(isp, &src->ridacq_vp_acquired, dst->ridacq_vp_acquired);
+	ISP_IOXGET_8(isp, &src->ridacq_vp_setup, dst->ridacq_vp_setup);
+	ISP_IOXGET_8(isp, &src->ridacq_vp_index, dst->ridacq_vp_index);
+	ISP_IOXGET_8(isp, &src->ridacq_vp_status, dst->ridacq_vp_status);
 	ISP_IOXGET_16(isp, &src->ridacq_vp_port_lo, dst->ridacq_vp_port_lo);
 	ISP_IOXGET_8(isp, &src->ridacq_vp_port_hi, dst->ridacq_vp_port_hi);
 	ISP_IOXGET_8(isp, &src->ridacq_format, dst->ridacq_format);
@@ -1742,17 +1746,6 @@ isp_get_ridacq(ispsoftc_t *isp, isp_rida
 	for (i = 0; i < sizeof (src->ridacq_reserved1) / sizeof (src->ridacq_reserved1[0]); i++) {
 		ISP_IOXGET_16(isp, &src->ridacq_reserved1[i], dst->ridacq_reserved1[i]);
 	}
-	if (dst->ridacq_format == 0) {
-		ISP_IOXGET_8(isp, &src->un.type0.ridacq_vp_acquired, dst->un.type0.ridacq_vp_acquired);
-		ISP_IOXGET_8(isp, &src->un.type0.ridacq_vp_setup, dst->un.type0.ridacq_vp_setup);
-		ISP_IOXGET_16(isp, &src->un.type0.ridacq_reserved0, dst->un.type0.ridacq_reserved0);
-	} else if (dst->ridacq_format == 1) {
-		ISP_IOXGET_16(isp, &src->un.type1.ridacq_vp_count, dst->un.type1.ridacq_vp_count);
-		ISP_IOXGET_8(isp, &src->un.type1.ridacq_vp_index, dst->un.type1.ridacq_vp_index);
-		ISP_IOXGET_8(isp, &src->un.type1.ridacq_vp_status, dst->un.type1.ridacq_vp_status);
-	} else {
-		ISP_MEMZERO(&dst->un, sizeof (dst->un));
-	}
 }
 
 

Modified: stable/10/sys/dev/isp/ispmbox.h
==============================================================================
--- stable/10/sys/dev/isp/ispmbox.h	Mon Nov 30 21:34:17 2015	(r291506)
+++ stable/10/sys/dev/isp/ispmbox.h	Mon Nov 30 21:35:03 2015	(r291507)
@@ -1485,18 +1485,10 @@ typedef struct {
 typedef struct {
 	isphdr_t	ridacq_hdr;
 	uint32_t	ridacq_handle;
-	union {
-		struct {
-			uint8_t		ridacq_vp_acquired;
-			uint8_t		ridacq_vp_setup;
-			uint16_t	ridacq_reserved0;
-		} type0;	/* type 0 */
-		struct {
-			uint16_t	ridacq_vp_count;
-			uint8_t		ridacq_vp_index;
-			uint8_t		ridacq_vp_status;
-		} type1;	/* type 1 */
-	} un;
+	uint8_t		ridacq_vp_acquired;
+	uint8_t		ridacq_vp_setup;
+	uint8_t		ridacq_vp_index;
+	uint8_t		ridacq_vp_status;
 	uint16_t	ridacq_vp_port_lo;
 	uint8_t		ridacq_vp_port_hi;
 	uint8_t		ridacq_format;		/* 0 or 1 */
@@ -1506,8 +1498,11 @@ typedef struct {
 
 #define	RIDACQ_STS_COMPLETE	0
 #define	RIDACQ_STS_UNACQUIRED	1
-#define	RIDACQ_STS_CHANGED	20
-
+#define	RIDACQ_STS_CHANGED	2
+#define	RIDACQ_STS_SNS_TIMEOUT	3
+#define	RIDACQ_STS_SNS_REJECTED	4
+#define	RIDACQ_STS_SCR_TIMEOUT	5
+#define	RIDACQ_STS_SCR_REJECTED	6
 
 /*
  * Simple Name Server Data Structures



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511302135.tAULZ3oR069888>