diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 32245225ddb8..2184465bda95 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -58,6 +58,10 @@ typedef enum { CAM_CDB_POINTER = 0x00000001,/* The CDB field is a pointer */ CAM_QUEUE_ENABLE = 0x00000002,/* SIM queue actions are enabled */ CAM_CDB_LINKED = 0x00000004,/* CCB contains a linked CDB */ + CAM_NEGOTIATE = 0x00000008,/* + * Perform transport negotiation + * with this command. + */ CAM_SCATTER_VALID = 0x00000010,/* Scatter/gather list is valid */ CAM_DIS_AUTOSENSE = 0x00000020,/* Disable autosense feature */ CAM_DIR_RESV = 0x00000000,/* Data direction (00:reserved) */ diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 72f971cca6af..4e2a6b461e9c 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -5786,6 +5786,15 @@ xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device, 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) + cts->sync_period = 0xa; + switch (cts->bus_width) { case MSG_EXT_WDTR_BUS_32_BIT: if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) == 0