#include <linux/blkdev.h>
#include <linux/parport.h>
#include <linux/workqueue.h>
+#include <linux/delay.h>
#include <asm/io.h>
#include <scsi/scsi.h>
return *(imm_struct **)&host->hostdata;
}
-static spinlock_t arbitration_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(arbitration_lock);
static void got_it(imm_struct *dev)
{
if (imm_connect(dev, 0) != 1)
return -EIO;
imm_reset_pulse(dev->base);
- udelay(1000); /* Delay to allow devices to settle */
+ mdelay(1); /* Delay to allow devices to settle */
imm_disconnect(dev);
- udelay(1000); /* Another delay to allow devices to settle */
+ mdelay(1); /* Another delay to allow devices to settle */
return device_check(dev);
}
case DID_OK:
break;
case DID_NO_CONNECT:
- printk("imm: no device at SCSI ID %i\n", cmd->target);
+ printk("imm: no device at SCSI ID %i\n", cmd->device->id);
break;
case DID_BUS_BUSY:
printk("imm: BUS BUSY - EPP timeout detected\n");
/* Phase 2 - We are now talking to the scsi bus */
case 2:
- if (!imm_select(dev, cmd->device->id)) {
+ if (!imm_select(dev, scmd_id(cmd))) {
imm_fail(dev, DID_NO_CONNECT);
return 0;
}
imm_connect(dev, CONNECT_NORMAL);
imm_reset_pulse(dev->base);
- udelay(1000); /* device settle delay */
+ mdelay(1); /* device settle delay */
imm_disconnect(dev);
- udelay(1000); /* device settle delay */
+ mdelay(1); /* device settle delay */
return SUCCESS;
}
return -ENODEV;
}
+static int imm_adjust_queue(struct scsi_device *device)
+{
+ blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH);
+ return 0;
+}
+
static struct scsi_host_template imm_template = {
.module = THIS_MODULE,
.proc_name = "imm",
.cmd_per_lun = 1,
.use_clustering = ENABLE_CLUSTERING,
.can_queue = 1,
+ .slave_alloc = imm_adjust_queue,
+ .unchecked_isa_dma = 1, /* imm cannot deal with highmem, so
+ * this is an easy trick to ensure
+ * all io pages for this host reside
+ * in low memory */
};
/***************************************************************************