Author: mav
Date: Thu Sep  3 12:56:57 2015
New Revision: 287433
URL: https://svnweb.freebsd.org/changeset/base/287433

Log:
  Small UA cleanup.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_error.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c      Thu Sep  3 12:15:14 2015        (r287432)
+++ head/sys/cam/ctl/ctl.c      Thu Sep  3 12:56:57 2015        (r287433)
@@ -437,7 +437,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);
@@ -1012,6 +1012,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)
 {
@@ -9100,7 +9114,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);
                }
@@ -11088,24 +11102,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: head/sys/cam/ctl/ctl.h
==============================================================================
--- head/sys/cam/ctl/ctl.h      Thu Sep  3 12:15:14 2015        (r287432)
+++ head/sys/cam/ctl/ctl.h      Thu Sep  3 12:56:57 2015        (r287433)
@@ -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: head/sys/cam/ctl/ctl_error.c
==============================================================================
--- head/sys/cam/ctl/ctl_error.c        Thu Sep  3 12:15:14 2015        
(r287432)
+++ head/sys/cam/ctl/ctl_error.c        Thu Sep  3 12:56:57 2015        
(r287433)
@@ -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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to