vserver 2.0 rc7
[linux-2.6.git] / drivers / scsi / aacraid / sa.c
index 13e8818..bd6c307 100644 (file)
@@ -62,7 +62,7 @@ static irqreturn_t aac_sa_intr(int irq, void *dev_id, struct pt_regs *regs)
 
        if (intstat & mask) {
                if (intstat & PrintfReady) {
-                       aac_printf(dev, le32_to_cpu(sa_readl(dev, Mailbox5)));
+                       aac_printf(dev, sa_readl(dev, Mailbox5));
                        sa_writew(dev, DoorbellClrReg_p, PrintfReady); /* clear PrintfReady */
                        sa_writew(dev, DoorbellReg_s, PrintfDone);
                } else if (intstat & DOORBELL_1) {      // dev -> Host Normal Command Ready
@@ -128,7 +128,7 @@ void aac_sa_notify_adapter(struct aac_dev *dev, u32 event)
  *     @p1: first parameter
  *     @ret: adapter status
  *
- *     This routine will send a synchronous comamnd to the adapter and wait 
+ *     This routine will send a synchronous command to the adapter and wait 
  *     for its completion.
  */
 
@@ -139,11 +139,11 @@ static int sa_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *ret)
        /*
         *      Write the Command into Mailbox 0
         */
-       sa_writel(dev, Mailbox0, cpu_to_le32(command));
+       sa_writel(dev, Mailbox0, command);
        /*
         *      Write the parameters into Mailboxes 1 - 4
         */
-       sa_writel(dev, Mailbox1, cpu_to_le32(p1));
+       sa_writel(dev, Mailbox1, p1);
        sa_writel(dev, Mailbox2, 0);
        sa_writel(dev, Mailbox3, 0);
        sa_writel(dev, Mailbox4, 0);
@@ -186,7 +186,8 @@ static int sa_sync_cmd(struct aac_dev *dev, u32 command, u32 p1, u32 *ret)
        /*
         *      Pull the synch status from Mailbox 0.
         */
-       *ret = le32_to_cpu(sa_readl(dev, Mailbox0));
+       if (ret)
+               *ret = sa_readl(dev, Mailbox0);
        return 0;
 }
 
@@ -218,9 +219,8 @@ static void aac_sa_start_adapter(struct aac_dev *dev)
         * Fill in the remaining pieces of the init.
         */
        init = dev->init;
-       init->HostElapsedSeconds = cpu_to_le32(jiffies/HZ);
+       init->HostElapsedSeconds = cpu_to_le32(get_seconds());
 
-       dprintk(("INIT\n"));
        /*
         * Tell the adapter we are back and up and running so it will scan its command
         * queues and enable our interrupts
@@ -230,10 +230,8 @@ static void aac_sa_start_adapter(struct aac_dev *dev)
         *      First clear out all interrupts.  Then enable the one's that 
         *      we can handle.
         */
-       dprintk(("MASK\n"));
        sa_writew(dev, SaDbCSR.PRISETIRQMASK, cpu_to_le16(0xffff));
        sa_writew(dev, SaDbCSR.PRICLEARIRQMASK, (PrintfReady | DOORBELL_1 | DOORBELL_2 | DOORBELL_3 | DOORBELL_4));
-       dprintk(("SYNCCMD\n"));
        /* We can only use a 32 bit address here */
        sa_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa, &ret);
 }
@@ -286,14 +284,12 @@ int aac_sa_init(struct aac_dev *dev)
        int instance;
        const char *name;
 
-       dprintk(("PREINST\n"));
        instance = dev->id;
        name     = dev->name;
 
        /*
         *      Map in the registers from the adapter.
         */
-       dprintk(("PREMAP\n"));
 
        if((dev->regs.sa = ioremap((unsigned long)dev->scsi_host_ptr->base, 8192))==NULL)
        {       
@@ -320,15 +316,15 @@ int aac_sa_init(struct aac_dev *dev)
         */
        while (!(sa_readl(dev, Mailbox7) & KERNEL_UP_AND_RUNNING)) {
                if (time_after(jiffies, start+180*HZ)) {
-                       status = sa_readl(dev, Mailbox7) >> 16;
-                       printk(KERN_WARNING "%s%d: adapter kernel failed to start, init status = %d.\n", name, instance, le32_to_cpu(status));
+                       status = sa_readl(dev, Mailbox7);
+                       printk(KERN_WARNING "%s%d: adapter kernel failed to start, init status = %lx.\n", 
+                                       name, instance, status);
                        goto error_iounmap;
                }
                set_current_state(TASK_UNINTERRUPTIBLE);
                schedule_timeout(1);
        }
 
-       dprintk(("ATIRQ\n"));
        if (request_irq(dev->scsi_host_ptr->irq, aac_sa_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev ) < 0) {
                printk(KERN_WARNING "%s%d: Interrupt unavailable.\n", name, instance);
                goto error_iounmap;
@@ -343,12 +339,10 @@ int aac_sa_init(struct aac_dev *dev)
        dev->a_ops.adapter_sync_cmd = sa_sync_cmd;
        dev->a_ops.adapter_check_health = aac_sa_check_health;
 
-       dprintk(("FUNCDONE\n"));
 
        if(aac_init_adapter(dev) == NULL)
                goto error_irq;
 
-       dprintk(("NEWADAPTDONE\n"));
        /*
         *      Start any kernel threads needed
         */
@@ -362,9 +356,7 @@ int aac_sa_init(struct aac_dev *dev)
         *      Tell the adapter that all is configure, and it can start 
         *      accepting requests
         */
-       dprintk(("STARTING\n"));
        aac_sa_start_adapter(dev);
-       dprintk(("STARTED\n"));
        return 0;