From owner-svn-src-head@freebsd.org Thu Sep 3 12:56:59 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 324C49C87E1; Thu, 3 Sep 2015 12:56:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23379E38; Thu, 3 Sep 2015 12:56:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t83CuxeE043611; Thu, 3 Sep 2015 12:56:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t83Cuwao043608; Thu, 3 Sep 2015 12:56:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201509031256.t83Cuwao043608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 3 Sep 2015 12:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287433 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2015 12:56:59 -0000 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;