Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2015 08:48:48 +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: r288725 - stable/10/sys/cam/ctl
Message-ID:  <201510050848.t958mmnA014439@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Oct  5 08:48:47 2015
New Revision: 288725
URL: https://svnweb.freebsd.org/changeset/base/288725

Log:
  MFC r287433: Small UA cleanup.

Modified:
  stable/10/sys/cam/ctl/ctl.c
  stable/10/sys/cam/ctl/ctl.h
  stable/10/sys/cam/ctl/ctl_error.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl.c	Mon Oct  5 08:47:45 2015	(r288724)
+++ stable/10/sys/cam/ctl/ctl.c	Mon Oct  5 08:48:47 2015	(r288725)
@@ -439,7 +439,7 @@ static int ctl_scsiio_lun_check(struct c
 #ifdef notyet
 static void ctl_failover(void);
 #endif
-static void ctl_clear_ua(struct ctl_softc *ctl_softc, uint32_t initidx,
+static void ctl_clr_ua_allluns(struct ctl_softc *ctl_softc, uint32_t initidx,
 			 ctl_ua_type ua_type);
 static int ctl_scsiio_precheck(struct ctl_softc *ctl_softc,
 			       struct ctl_scsiio *ctsio);
@@ -1014,6 +1014,20 @@ ctl_clr_ua_all(struct ctl_lun *lun, uint
 	}
 }
 
+static void
+ctl_clr_ua_allluns(struct ctl_softc *ctl_softc, uint32_t initidx,
+    ctl_ua_type ua_type)
+{
+	struct ctl_lun *lun;
+
+	mtx_assert(&ctl_softc->ctl_lock, MA_OWNED);
+	STAILQ_FOREACH(lun, &ctl_softc->lun_list, links) {
+		mtx_lock(&lun->lun_lock);
+		ctl_clr_ua(lun, initidx, ua_type);
+		mtx_unlock(&lun->lun_lock);
+	}
+}
+
 static int
 ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS)
 {
@@ -9102,7 +9116,7 @@ ctl_request_sense(struct ctl_scsiio *cts
 		if (ua_type == CTL_UA_LUN_CHANGE) {
 			mtx_unlock(&lun->lun_lock);
 			mtx_lock(&ctl_softc->ctl_lock);
-			ctl_clear_ua(ctl_softc, initidx, ua_type);
+			ctl_clr_ua_allluns(ctl_softc, initidx, ua_type);
 			mtx_unlock(&ctl_softc->ctl_lock);
 			mtx_lock(&lun->lun_lock);
 		}
@@ -11090,24 +11104,6 @@ ctl_failover(void)
 }
 #endif
 
-static void
-ctl_clear_ua(struct ctl_softc *ctl_softc, uint32_t initidx,
-	     ctl_ua_type ua_type)
-{
-	struct ctl_lun *lun;
-	ctl_ua_type *pu;
-
-	mtx_assert(&ctl_softc->ctl_lock, MA_OWNED);
-
-	STAILQ_FOREACH(lun, &ctl_softc->lun_list, links) {
-		mtx_lock(&lun->lun_lock);
-		pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT];
-		if (pu != NULL)
-			pu[initidx % CTL_MAX_INIT_PER_PORT] &= ~ua_type;
-		mtx_unlock(&lun->lun_lock);
-	}
-}
-
 static int
 ctl_scsiio_precheck(struct ctl_softc *softc, struct ctl_scsiio *ctsio)
 {

Modified: stable/10/sys/cam/ctl/ctl.h
==============================================================================
--- stable/10/sys/cam/ctl/ctl.h	Mon Oct  5 08:47:45 2015	(r288724)
+++ stable/10/sys/cam/ctl/ctl.h	Mon Oct  5 08:48:47 2015	(r288725)
@@ -120,8 +120,6 @@ typedef enum {
 	CTL_UA_LUN_CHANGE	= 0x0020,
 	CTL_UA_MODE_CHANGE	= 0x0040,
 	CTL_UA_LOG_CHANGE	= 0x0080,
-	CTL_UA_LVD		= 0x0100,
-	CTL_UA_SE		= 0x0200,
 	CTL_UA_RES_PREEMPT	= 0x0400,
 	CTL_UA_RES_RELEASE	= 0x0800,
 	CTL_UA_REG_PREEMPT  	= 0x1000,

Modified: stable/10/sys/cam/ctl/ctl_error.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_error.c	Mon Oct  5 08:47:45 2015	(r288724)
+++ stable/10/sys/cam/ctl/ctl_error.c	Mon Oct  5 08:48:47 2015	(r288725)
@@ -446,16 +446,6 @@ ctl_build_ua(struct ctl_lun *lun, uint32
 		asc = 0x2A;
 		ascq = 0x02;
 		break;
-	case CTL_UA_LVD:
-		/* 29h/06h  TRANSCEIVER MODE CHANGED TO LVD */
-		asc = 0x29;
-		ascq = 0x06;
-		break;
-	case CTL_UA_SE:
-		/* 29h/05h  TRANSCEIVER MODE CHANGED TO SINGLE-ENDED */
-		asc = 0x29;
-		ascq = 0x05;
-		break;
 	case CTL_UA_RES_PREEMPT:
 		/* 2Ah/03h  RESERVATIONS PREEMPTED */
 		asc = 0x2A;



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