1.2239_FC5 -> 1.2255_FC5
[linux-2.6.git] / drivers / scsi / ppa.c
index 390bbbd..b0eba39 100644 (file)
@@ -6,17 +6,16 @@
  * (c) 1995,1996 Grant R. Guenther, grant@torque.net,
  * under the terms of the GNU General Public License.
  * 
- * Current Maintainer: David Campbell (Perth, Western Australia, GMT+0800)
- *                     campbell@torque.net
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
 #include <linux/parport.h>
 #include <linux/workqueue.h>
+#include <linux/delay.h>
+#include <linux/jiffies.h>
 #include <asm/io.h>
 
 #include <scsi/scsi.h>
@@ -49,7 +48,7 @@ static inline ppa_struct *ppa_dev(struct Scsi_Host *host)
        return *(ppa_struct **)&host->hostdata;
 }
 
-static spinlock_t arbitration_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(arbitration_lock);
 
 static void got_it(ppa_struct *dev)
 {
@@ -682,7 +681,7 @@ static void ppa_interrupt(void *data)
 
        ppa_pb_dismiss(dev);
 
-       dev->cur_cmd = 0;
+       dev->cur_cmd = NULL;
 
        cmd->scsi_done(cmd);
 }
@@ -725,7 +724,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
                                retv--;
 
                        if (retv) {
-                               if ((jiffies - dev->jstart) > (1 * HZ)) {
+                               if (time_after(jiffies, dev->jstart + (1 * HZ))) {
                                        printk
                                            ("ppa: Parallel port cable is unplugged!!\n");
                                        ppa_fail(dev, DID_BUS_BUSY);
@@ -739,7 +738,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd)
                }
 
        case 2:         /* Phase 2 - We are now talking to the scsi bus */
-               if (!ppa_select(dev, cmd->device->id)) {
+               if (!ppa_select(dev, scmd_id(cmd))) {
                        ppa_fail(dev, DID_NO_CONNECT);
                        return 0;
                }
@@ -891,9 +890,9 @@ static int ppa_reset(struct scsi_cmnd *cmd)
 
        ppa_connect(dev, CONNECT_NORMAL);
        ppa_reset_pulse(dev->base);
-       udelay(1000);           /* device settle delay */
+       mdelay(1);              /* device settle delay */
        ppa_disconnect(dev);
-       udelay(1000);           /* device settle delay */
+       mdelay(1);              /* device settle delay */
        return SUCCESS;
 }
 
@@ -980,6 +979,12 @@ static int device_check(ppa_struct *dev)
        return -ENODEV;
 }
 
+static int ppa_adjust_queue(struct scsi_device *device)
+{
+       blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH);
+       return 0;
+}
+
 static struct scsi_host_template ppa_template = {
        .module                 = THIS_MODULE,
        .proc_name              = "ppa",
@@ -995,6 +1000,7 @@ static struct scsi_host_template ppa_template = {
        .cmd_per_lun            = 1,
        .use_clustering         = ENABLE_CLUSTERING,
        .can_queue              = 1,
+       .slave_alloc            = ppa_adjust_queue,
 };
 
 /***************************************************************************