/* imm.c -- low level driver for the IOMEGA MatchMaker * parallel port SCSI host adapter. * * (The IMM is the embedded controller in the ZIP Plus drive.) * * Current Maintainer: David Campbell (Perth, Western Australia) * campbell@torque.net * * My unoffical company acronym list is 21 pages long: * FLA: Four letter acronym with built in facility for * future expansion to five letters. */#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<asm/io.h>#include<scsi/scsi.h>#include<scsi/scsi_cmnd.h>#include<scsi/scsi_device.h>#include<scsi/scsi_host.h>/* The following #define is to avoid a clash with hosts.c */#define IMM_PROBE_SPP 0x0001#define IMM_PROBE_PS2 0x0002#define IMM_PROBE_ECR 0x0010#define IMM_PROBE_EPP17 0x0100#define IMM_PROBE_EPP19 0x0200typedefstruct{structpardevice*dev;/* Parport device entry */intbase;/* Actual port address */intbase_hi;/* Hi Base address for ECP-ISA chipset */intmode;/* Transfer mode */structscsi_cmnd*cur_cmd;/* Current queued command */structwork_structimm_tq;/* Polling interrupt stuff */unsignedlongjstart;/* Jiffies at start */unsignedfailed:1;/* Failure flag */unsigneddp:1;/* Data phase present */unsignedrd:1;/* Read data in data phase */unsignedwanted:1;/* Parport sharing busy flag */wait_queue_head_t*waiting;structScsi_Host*host;structlist_headlist;}imm_struct;staticvoidimm_reset_pulse(unsignedintbase);staticintdevice_check(imm_struct*dev);#include"imm.h"staticinlineimm_struct*imm_dev(structScsi_Host*host){return*(imm_struct**)&host->hostdata;}staticDEFINE_SPINLOCK(arbitration_lock);staticvoidgot_it(imm_struct*dev){dev->base=dev->dev->port->base;if(dev->cur_cmd)dev->cur_cmd->SCp.phase=1;elsewake_up(dev->waiting);}staticvoidimm_wakeup(void*ref){imm_struct*dev=(imm_struct*)ref;unsignedlongflags;spin_lock_irqsave(&arbitration_lock,flags);if(dev->wanted){parport_claim(dev->dev);got_it(dev);dev->wanted=0;}spin_unlock_irqrestore(&arbitration_lock,flags);}staticintimm_pb_claim(imm_struct*dev){