patch-2.4.20 linux-2.4.20/drivers/scsi/aacraid/comminit.c

Next file: linux-2.4.20/drivers/scsi/aacraid/commsup.c
Previous file: linux-2.4.20/drivers/scsi/aacraid/commctrl.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/drivers/scsi/aacraid/comminit.c linux-2.4.20/drivers/scsi/aacraid/comminit.c
@@ -38,6 +38,7 @@
 #include <linux/spinlock.h>
 #include <linux/slab.h>
 #include <linux/blk.h>
+#include <linux/completion.h>
 #include <asm/semaphore.h>
 #include "scsi.h"
 #include "hosts.h"
@@ -57,6 +58,7 @@
 	struct aac_init *init;
 	dma_addr_t phys;
 
+	/* FIXME: Adaptec add 128 bytes to this value - WHY ?? */
 	size = fibsize + sizeof(struct aac_init) + commsize + commalign + printfbufsiz;
 
 	base = pci_alloc_consistent(dev->pdev, size, &phys);
@@ -72,6 +74,14 @@
 	dev->init = (struct aac_init *)(base + fibsize);
 	dev->init_pa = phys + fibsize;
 
+	/*
+	 *	Cache the upper bits of the virtual mapping for 64bit boxes
+	 *	FIXME: this crap should be rewritten
+	 */
+#if BITS_PER_LONG >= 64 
+	dev->fib_base_va = ((ulong)base & 0xffffffff00000000);
+#endif
+
 	init = dev->init;
 
 	init->InitStructRevision = cpu_to_le32(ADAPTER_INIT_STRUCT_REVISION);
@@ -82,7 +92,7 @@
 	 *	Adapter Fibs are the first thing allocated so that they
 	 *	start page aligned
 	 */
-	init->AdapterFibsVirtualAddress = cpu_to_le32((long)base);
+	init->AdapterFibsVirtualAddress = cpu_to_le32((u32)base);
 	init->AdapterFibsPhysicalAddress = cpu_to_le32(phys);
 	init->AdapterFibsSize = cpu_to_le32(fibsize);
 	init->AdapterFibAlign = cpu_to_le32(sizeof(struct hw_fib));
@@ -238,7 +248,7 @@
 
 	queues = (struct aac_entry *)((unsigned char *)headers + hdrsize);
 
-	/* Adapter to Host normal priority Command queue */ 
+	/* Adapter to Host normal proirity Command queue */ 
 	comm->queue[HostNormCmdQueue].base = queues;
 	aac_queue_init(dev, &comm->queue[HostNormCmdQueue], headers, HOST_NORM_CMD_ENTRIES);
 	queues += HOST_NORM_CMD_ENTRIES;
@@ -319,7 +329,6 @@
 		return NULL;
 		
 	INIT_LIST_HEAD(&dev->fib_list);
-	spin_lock_init(&dev->fib_lock);
 	init_completion(&dev->aif_completion);
 	/*
 	 *	Add this adapter in to our dev List.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)