diff options
author | mav <mav@FreeBSD.org> | 2015-10-05 08:48:47 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-05 08:48:47 +0000 |
commit | 9c0e046e5c2e60bc09f9f043b08e8a57cba24660 (patch) | |
tree | 485b50e40f0b2c8edadb0ee77cb7fbf59e47f6b3 | |
parent | efb416ffd85275e8fdfe63e3c63c83e3e40661e4 (diff) | |
download | FreeBSD-src-9c0e046e5c2e60bc09f9f043b08e8a57cba24660.zip FreeBSD-src-9c0e046e5c2e60bc09f9f043b08e8a57cba24660.tar.gz |
MFC r287433: Small UA cleanup.
-rw-r--r-- | sys/cam/ctl/ctl.c | 36 | ||||
-rw-r--r-- | sys/cam/ctl/ctl.h | 2 | ||||
-rw-r--r-- | sys/cam/ctl/ctl_error.c | 10 |
3 files changed, 16 insertions, 32 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 8be9514..6dfd6f7 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -439,7 +439,7 @@ static int ctl_scsiio_lun_check(struct ctl_lun *lun, #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, uint32_t except, ctl_ua_type ua) } } +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 *ctsio) 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) { diff --git a/sys/cam/ctl/ctl.h b/sys/cam/ctl/ctl.h index 2826742..f672610 100644 --- a/sys/cam/ctl/ctl.h +++ b/sys/cam/ctl/ctl.h @@ -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, diff --git a/sys/cam/ctl/ctl_error.c b/sys/cam/ctl/ctl_error.c index 4b41331..8d98204 100644 --- a/sys/cam/ctl/ctl_error.c +++ b/sys/cam/ctl/ctl_error.c @@ -446,16 +446,6 @@ ctl_build_ua(struct ctl_lun *lun, uint32_t initidx, 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; |