]> git.hungrycats.org Git - linux/commitdiff
[PATCH] MegaRAID - compile fix for 2.5.9
authorNathan Dabney <smurf@osdl.org>
Tue, 23 Apr 2002 16:44:17 +0000 (09:44 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 23 Apr 2002 16:44:17 +0000 (09:44 -0700)
  This fixes compile errors.  It has been tested with a weekend of Bonnie++ 8GB
runs on a RAID0 setup at the OSDL.  This was built against and tested on 2.5.8
and applies cleanly to 2.5.9.

  LSI told me they have a version 2.0 of the driver in development but
it would be really nice to have the dang thing working now ;-)

drivers/scsi/megaraid.c

index 05aa504ff3d8cbb96034868f1f0220381f77f73b..fc7b32cf97a3666945c43ae9718ce2f309dba4a8 100644 (file)
 #include "sd.h"
 #include "scsi.h"
 #include "hosts.h"
+#include <scsi/scsicam.h>
 
 #include "megaraid.h"
 
@@ -1107,10 +1108,11 @@ static void mega_cmd_done (mega_host_config * megaCfg, mega_scb * pScb, int stat
                status = 0xF0;
        }
 #endif
+       
        if (SCpnt->cmnd[0] == INQUIRY && !islogical) {
                if ( SCpnt->use_sg ) {
                        sgList = (struct scatterlist *)SCpnt->request_buffer;
-                       memcpy(&c, sgList[0].address, 0x1);
+                       memcpy(&c, cpu_to_le32(sg_dma_address(&sgList[0])), 0x1);
                } else {
                        memcpy(&c, SCpnt->request_buffer, 0x1);
                }
@@ -4557,9 +4559,11 @@ static int megadev_ioctl (struct inode *inode, struct file *filep,
 #endif
        IO_LOCK_T;
 
-       if (!inode || !(dev = inode->i_rdev))
+       if (!inode)
                return -EINVAL;
 
+       dev = inode->i_rdev;
+
        if (_IOC_TYPE (cmd) != MEGAIOC_MAGIC)
                return (-EINVAL);
 
@@ -5104,16 +5108,16 @@ mega_del_logdrv(mega_host_config *this_hba, int logdrv)
         * Stop sending commands to the controller, queue them internally.
         * When deletion is complete, ISR will flush the queue.
         */
-       IO_LOCK;
+       IO_LOCK(this_hba->host);
        this_hba->quiescent = 1;
-       IO_UNLOCK;
+       IO_UNLOCK(this_hba->host);
 
        while( this_hba->qPcnt ) {
                        sleep_on_timeout( &wq, 1*HZ );  /* sleep for 1s */
        }
        rval = mega_do_del_logdrv(this_hba, logdrv);
 
-       IO_LOCK;
+       IO_LOCK(this_hba->host);
        /*
         * Attach the internal queue to the pending queue
         */
@@ -5158,7 +5162,7 @@ mega_del_logdrv(mega_host_config *this_hba, int logdrv)
        }
        this_hba->quiescent = 0;
 
-       IO_UNLOCK;
+       IO_UNLOCK(this_hba->host);
 
        return rval;
 }