From f81f1df515df097ff9a9b998000c2cad148d07d9 Mon Sep 17 00:00:00 2001 From: ken Date: Tue, 13 Mar 2001 22:35:28 +0000 Subject: In xpt_set_transfer_settings(), force async if either the period or the offset is set to 0. Re-arrange the DT limiting code so that we don't end up setting the period to 0xa if the user really wants async. The previous behavior seemed to confuse the aic(4) driver. PR: kern/22733 Reviewed by: gibbs --- sys/cam/cam_xpt.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'sys/cam') diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 39cf22f..0eee198 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -5836,22 +5836,24 @@ xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device, cts->flags &= ~CCB_TRANS_TAG_ENB; cts->flags |= cur_cts.flags & CCB_TRANS_TAG_ENB; } + if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0 && (inq_data->flags & SID_Sync) == 0) - || (cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { + || ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) + || (cts->sync_offset == 0) + || (cts->sync_period == 0)) { /* Force async */ cts->sync_period = 0; cts->sync_offset = 0; - } - - /* - * Don't allow DT transmission rates if the - * device does not support it. - */ - if ((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0 - && (inq_data->spi3data & SID_SPI_CLOCK_DT) == 0 - && cts->sync_period <= 0x9) + } else if ((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0 + && (inq_data->spi3data & SID_SPI_CLOCK_DT) == 0 + && cts->sync_period <= 0x9) { + /* + * Don't allow DT transmission rates if the + * device does not support it. + */ cts->sync_period = 0xa; + } switch (cts->bus_width) { case MSG_EXT_WDTR_BUS_32_BIT: -- cgit v1.1