Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_da.c
| Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | typedef enum { | ||||
| DA_FLAG_CAN_RC16 = 0x000400, | DA_FLAG_CAN_RC16 = 0x000400, | ||||
| DA_FLAG_PROBED = 0x000800, | DA_FLAG_PROBED = 0x000800, | ||||
| DA_FLAG_DIRTY = 0x001000, | DA_FLAG_DIRTY = 0x001000, | ||||
| DA_FLAG_ANNOUNCED = 0x002000, | DA_FLAG_ANNOUNCED = 0x002000, | ||||
| DA_FLAG_CAN_ATA_DMA = 0x004000, | DA_FLAG_CAN_ATA_DMA = 0x004000, | ||||
| DA_FLAG_CAN_ATA_LOG = 0x008000, | DA_FLAG_CAN_ATA_LOG = 0x008000, | ||||
| DA_FLAG_CAN_ATA_IDLOG = 0x010000, | DA_FLAG_CAN_ATA_IDLOG = 0x010000, | ||||
| DA_FLAG_CAN_ATA_SUPCAP = 0x020000, | DA_FLAG_CAN_ATA_SUPCAP = 0x020000, | ||||
| DA_FLAG_CAN_ATA_ZONE = 0x040000 | DA_FLAG_CAN_ATA_ZONE = 0x040000, | ||||
| DA_FLAG_TUR_PENDING = 0x080000 | |||||
| } da_flags; | } da_flags; | ||||
| typedef enum { | typedef enum { | ||||
| DA_Q_NONE = 0x00, | DA_Q_NONE = 0x00, | ||||
| DA_Q_NO_SYNC_CACHE = 0x01, | DA_Q_NO_SYNC_CACHE = 0x01, | ||||
| DA_Q_NO_6_BYTE = 0x02, | DA_Q_NO_6_BYTE = 0x02, | ||||
| DA_Q_NO_PREVENT = 0x04, | DA_Q_NO_PREVENT = 0x04, | ||||
| DA_Q_4K = 0x08, | DA_Q_4K = 0x08, | ||||
| ▲ Show 20 Lines • Show All 1,935 Lines • ▼ Show 20 Lines | if (xpt_path_periph(ccb->ccb_h.path) != periph && | ||||
| dareprobe(periph); | dareprobe(periph); | ||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case AC_SCSI_AEN: | case AC_SCSI_AEN: | ||||
| softc = (struct da_softc *)periph->softc; | softc = (struct da_softc *)periph->softc; | ||||
| cam_periph_lock(periph); | cam_periph_lock(periph); | ||||
| if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) { | if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR) && | ||||
| (softc->flags & DA_FLAG_TUR_PENDING) == 0) { | |||||
| if (da_periph_acquire(periph, DA_REF_TUR) == 0) { | if (da_periph_acquire(periph, DA_REF_TUR) == 0) { | ||||
| cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); | cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); | ||||
| daschedule(periph); | daschedule(periph); | ||||
| } | } | ||||
| } | } | ||||
| cam_periph_unlock(periph); | cam_periph_unlock(periph); | ||||
| /* FALLTHROUGH */ | /* FALLTHROUGH */ | ||||
| case AC_SENT_BDR: | case AC_SENT_BDR: | ||||
| ▲ Show 20 Lines • Show All 1,028 Lines • ▼ Show 20 Lines | skipstate: | ||||
| { | { | ||||
| struct bio *bp; | struct bio *bp; | ||||
| uint8_t tag_code; | uint8_t tag_code; | ||||
| more: | more: | ||||
| bp = cam_iosched_next_bio(softc->cam_iosched); | bp = cam_iosched_next_bio(softc->cam_iosched); | ||||
| if (bp == NULL) { | if (bp == NULL) { | ||||
| if (cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) { | if (cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) { | ||||
| softc->flags |= DA_FLAG_TUR_PENDING; | |||||
| cam_iosched_clr_work_flags(softc->cam_iosched, DA_WORK_TUR); | cam_iosched_clr_work_flags(softc->cam_iosched, DA_WORK_TUR); | ||||
| scsi_test_unit_ready(&start_ccb->csio, | scsi_test_unit_ready(&start_ccb->csio, | ||||
| /*retries*/ da_retry_count, | /*retries*/ da_retry_count, | ||||
| dadone, | dadone, | ||||
| MSG_SIMPLE_Q_TAG, | MSG_SIMPLE_Q_TAG, | ||||
| SSD_FULL_SIZE, | SSD_FULL_SIZE, | ||||
| da_default_timeout * 1000); | da_default_timeout * 1000); | ||||
| start_ccb->ccb_h.ccb_bp = NULL; | start_ccb->ccb_h.ccb_bp = NULL; | ||||
| ▲ Show 20 Lines • Show All 2,441 Lines • ▼ Show 20 Lines | case DA_CCB_DUMP: | ||||
| return; | return; | ||||
| case DA_CCB_TUR: | case DA_CCB_TUR: | ||||
| { | { | ||||
| if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { | if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { | ||||
| if (daerror(done_ccb, CAM_RETRY_SELTO, | if (daerror(done_ccb, CAM_RETRY_SELTO, | ||||
| SF_RETRY_UA | SF_NO_RECOVERY | SF_NO_PRINT) == | SF_RETRY_UA | SF_NO_RECOVERY | SF_NO_PRINT) == | ||||
| ERESTART) | ERESTART) | ||||
| return; | return; /* Will complete again, keep reference */ | ||||
| if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) | if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) | ||||
| cam_release_devq(done_ccb->ccb_h.path, | cam_release_devq(done_ccb->ccb_h.path, | ||||
| /*relsim_flags*/0, | /*relsim_flags*/0, | ||||
| /*reduction*/0, | /*reduction*/0, | ||||
| /*timeout*/0, | /*timeout*/0, | ||||
| /*getcount_only*/0); | /*getcount_only*/0); | ||||
| } | } | ||||
| xpt_release_ccb(done_ccb); | xpt_release_ccb(done_ccb); | ||||
| softc->flags &= ~DA_FLAG_TUR_PENDING; | |||||
| da_periph_release_locked(periph, DA_REF_TUR); | da_periph_release_locked(periph, DA_REF_TUR); | ||||
| return; | return; | ||||
| } | } | ||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| xpt_release_ccb(done_ccb); | xpt_release_ccb(done_ccb); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | |||||
| static void | static void | ||||
| damediapoll(void *arg) | damediapoll(void *arg) | ||||
| { | { | ||||
| struct cam_periph *periph = arg; | struct cam_periph *periph = arg; | ||||
| struct da_softc *softc = periph->softc; | struct da_softc *softc = periph->softc; | ||||
| if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR) && | if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR) && | ||||
| (softc->flags & DA_FLAG_TUR_PENDING) == 0 && | |||||
| LIST_EMPTY(&softc->pending_ccbs)) { | LIST_EMPTY(&softc->pending_ccbs)) { | ||||
| if (da_periph_acquire(periph, DA_REF_TUR) == 0) { | if (da_periph_acquire(periph, DA_REF_TUR) == 0) { | ||||
| cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); | cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); | ||||
| daschedule(periph); | daschedule(periph); | ||||
| } | } | ||||
| } | } | ||||
| /* Queue us up again */ | /* Queue us up again */ | ||||
| if (da_poll_period != 0) | if (da_poll_period != 0) | ||||
| ▲ Show 20 Lines • Show All 603 Lines • Show Last 20 Lines | |||||