X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fscsi%2Fsym53c416.c;h=e5c369bb568f5d9ae5fd23b8bb8423c1be9c6ba1;hb=6401bdcad536cc00589c38e7e1c140d3acc00087;hp=8befab7e98397b759c9c3a80989b5f4edb5f42ee;hpb=9cb83c7529d929c00f37d821daed1942a1b20602;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c index 8befab7..e5c369b 100644 --- a/drivers/scsi/sym53c416.c +++ b/drivers/scsi/sym53c416.c @@ -6,7 +6,7 @@ * Changes : * * Marcelo Tosatti : Added io_request_lock locking - * Alan Cox : Cleaned up code formatting + * Alan Cox : Cleaned up code formatting * Fixed an irq locking bug * Added ISAPnP support * Bjoern A. Zeeb : Initial irq locking updates @@ -187,16 +187,16 @@ #define sym53c416_base_2 sym53c416_2 #define sym53c416_base_3 sym53c416_3 -static unsigned int sym53c416_base[2] = {0,0}; -static unsigned int sym53c416_base_1[2] = {0,0}; -static unsigned int sym53c416_base_2[2] = {0,0}; -static unsigned int sym53c416_base_3[2] = {0,0}; +static unsigned int sym53c416_base[2]; +static unsigned int sym53c416_base_1[2]; +static unsigned int sym53c416_base_2[2]; +static unsigned int sym53c416_base_3[2]; #endif #define MAXHOSTS 4 -#define SG_ADDRESS(buffer) ((char *) (page_address((buffer)->page)+(buffer)->offset)) +#define SG_ADDRESS(buffer) ((char *) sg_virt((buffer))) enum phases { @@ -328,27 +328,13 @@ static __inline__ unsigned int sym53c416_write(int base, unsigned char *buffer, static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id) { struct Scsi_Host *dev = dev_id; - int base = 0; + int base = dev->io_port; int i; unsigned long flags = 0; unsigned char status_reg, pio_int_reg, int_reg; struct scatterlist *sg; unsigned int tot_trans = 0; - /* We search the base address of the host adapter which caused the interrupt */ - /* FIXME: should pass dev_id sensibly as hosts[i] */ - for(i = 0; i < host_index && !base; i++) - if(irq == hosts[i].irq) - base = hosts[i].base; - /* If no adapter found, we cannot handle the interrupt. Leave a message */ - /* and continue. This should never happen... */ - if(!base) - { - printk(KERN_ERR "sym53c416: No host adapter defined for interrupt %d\n", irq); - return IRQ_NONE; - } - /* Now we have the base address and we can start handling the interrupt */ - spin_lock_irqsave(dev->host_lock,flags); status_reg = inb(base + STATUS_REG); pio_int_reg = inb(base + PIO_INT_REG); @@ -635,25 +621,25 @@ int __init sym53c416_detect(struct scsi_host_template *tpnt) int ints[3]; ints[0] = 2; - if(sym53c416_base) + if(sym53c416_base[0]) { ints[1] = sym53c416_base[0]; ints[2] = sym53c416_base[1]; sym53c416_setup(NULL, ints); } - if(sym53c416_base_1) + if(sym53c416_base_1[0]) { ints[1] = sym53c416_base_1[0]; ints[2] = sym53c416_base_1[1]; sym53c416_setup(NULL, ints); } - if(sym53c416_base_2) + if(sym53c416_base_2[0]) { ints[1] = sym53c416_base_2[0]; ints[2] = sym53c416_base_2[1]; sym53c416_setup(NULL, ints); } - if(sym53c416_base_3) + if(sym53c416_base_3[0]) { ints[1] = sym53c416_base_3[0]; ints[2] = sym53c416_base_3[1]; @@ -854,6 +840,5 @@ static struct scsi_host_template driver_template = { .cmd_per_lun = 1, .unchecked_isa_dma = 1, .use_clustering = ENABLE_CLUSTERING, - .use_sg_chaining = ENABLE_SG_CHAINING, }; #include "scsi_module.c"