* Called once per device the bus scan. Use it to force the queue_depth
* member to 1 if a device does not support Q tags.
*/
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,44)
int
-mptscsih_slave_attach(Scsi_Device *device)
+mptscsih_slave_configure(Scsi_Device *device)
{
+ struct Scsi_Host *host = device->host;
VirtDevice *pTarget;
- pTarget = device->hostdata;
- if (!device->tagged_supported ||
- !(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) {
- scsi_adjust_queue_depth(device, 0, 1);
- } else {
- scsi_adjust_queue_depth(device, MSG_SIMPLE_TAG,
- device->host->can_queue >> 1);
+ MPT_SCSI_HOST *hd;
+
+ hd = (MPT_SCSI_HOST *)host->hostdata;
+ if (hd && (hd->Targets != NULL)) {
+ pTarget = hd->Targets[device->id];
+ if (pTarget) {
+ if (!device->tagged_supported ||
+ !(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) {
+ scsi_adjust_queue_depth(device, 0, 1);
+ } else {
+ scsi_adjust_queue_depth(device, MSG_SIMPLE_TAG,
+ device->host->can_queue >> 1);
+ }
+ }
}
return 0;
}
.detect = x_scsi_detect, \
.release = x_scsi_release, \
.info = x_scsi_info, \
- .command = NULL, \
-- .queuecommand = x_scsi_queuecommand, \
- .slave_configure = x_scsi_slave_configure,\
- .slave_attach = x_scsi_slave_attach, \
- .eh_strategy_handler = NULL, \
- .eh_abort_handler = x_scsi_abort, \
- .eh_device_reset_handler = x_scsi_dev_reset, \
- .eh_bus_reset_handler = x_scsi_bus_reset, \
- .eh_host_reset_handler = x_scsi_host_reset, \
- .bios_param = x_scsi_bios_param, \
- .can_queue = MPT_SCSI_CAN_QUEUE, \
- .this_id = -1, \
- .sg_tablesize = MPT_SCSI_SG_DEPTH, \
- .max_sectors = MPT_SCSI_MAX_SECTORS, \
- .cmd_per_lun = MPT_SCSI_CMD_PER_LUN, \
- .unchecked_isa_dma = 0, \
- .use_clustering = ENABLE_CLUSTERING, \
-}
-
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,1)
-
-#define MPT_SCSIHOST { \
- PROC_SCSI_DECL \
- .name = "MPT SCSI Host", \
- .detect = x_scsi_detect, \
- .release = x_scsi_release, \
- .info = x_scsi_info, \
- .command = NULL, \
- .queuecommand = x_scsi_queuecommand, \
- .eh_strategy_handler = NULL, \
.eh_abort_handler = x_scsi_abort, \
.eh_device_reset_handler = x_scsi_dev_reset, \
.eh_bus_reset_handler = x_scsi_bus_reset, \