#include "sd.h"
#include "scsi.h"
#include "hosts.h"
+#include <scsi/scsicam.h>
#include "megaraid.h"
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);
}
#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);
* 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
*/
}
this_hba->quiescent = 0;
- IO_UNLOCK;
+ IO_UNLOCK(this_hba->host);
return rval;
}