#if LINUX_VERSION_CODE < 0x20100
#define MEGARAID \
--- linux/drivers/scsi/megaraid.c.save Tue Jan 4 14:44:41 2000
+++ linux/drivers/scsi/megaraid.c Tue Jan 4 00:57:17 2000
@@ -2,14 +2,14 @@
*
* Linux MegaRAID device driver
*
- * Copyright 1998 American Megatrends Inc.
+ * Copyright 1999 American Megatrends Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * Version : 1.05
+ * Version : 1.07
*
* Description: Linux device driver for AMI MegaRAID controller
*
@@ -120,6 +120,9 @@
* also enables the driver to handle large amount of I/O requests for
* long duration of time.
*
+ * Version 1.07
+ * Removed the usage of uaccess.h file for kernel versions less than
+ * 2.0.36, as this file is not present in those versions.
*
* BUGS:
* Some older 2.1 kernels (eg. 2.1.90) have a bug in pci.c that
@@ -135,7 +138,7 @@
#define CRLFSTR "\n"
#define IOCTL_CMD_NEW 0x81
SCpnt = pScb->SCpnt;
- /*freeSCB(megaCfg, pScb);*/ /*delay this to the end of this func.*/
pthru = &pScb->pthru;
mbox = (mega_mailbox *) &pScb->mboxData;
+#if LINUX_VERSION_CODE > 0x020024
+/*
+ * usage of the function copy from user is used in case of data more than
+ * 4KB. This is used only with adapters which supports more than 8 logical
+ * drives. This feature is disabled on kernels earlier or same as 2.0.36
+ * as the uaccess.h file is not available with those kernels.
+ */
+
if (SCpnt->cmnd[0] == IOCTL_CMD_NEW) {
/* use external data area for large xfers */
/* If cmnd[0] is set to IOCTL_CMD_NEW then *
@@ -938,6 +947,7 @@
copy_from_user(kern_area,user_area,xfer_size);
pScb->kern_area = kern_area;
}
+#endif
struct pci_dev *pdev = pci_devices;
@@ -1590,7 +1561,7 @@
pcibios_read_config_word (pciBus, pciDevFun,
PCI_CONF_AMISIG,
&magic);
- if (magic != AMI_SIGNATURE) {
+ if ((magic != AMI_SIGNATURE) && (magic != AMI_SIGNATURE_471) ){
pciIdx++;
continue; /* not an AMI board */
}
@@ -1824,9 +1795,6 @@
/* If driver in abort or reset.. cancel this command */
if (megaCfg->flag & IN_ABORT) {
-#if DEBUG
-printk("mq: got a request while in abort\n");
-#endif
SCpnt->result = (DID_ABORT << 16);
/* Add Scsi_Command to end of completed queue */
if( megaCfg->qCompletedH == NULL ) {
@@ -1843,9 +1811,6 @@
return 0;
}
else if (megaCfg->flag & IN_RESET) {
-#if DEBUG
-printk("mq: got a request while in reset\n");
-#endif
SCpnt->result = (DID_RESET << 16);
/* Add Scsi_Command to end of completed queue */
if( megaCfg->qCompletedH == NULL ) {
@@ -1878,16 +1843,9 @@
megaCfg->qPendingT->next = NULL;
megaCfg->qPcnt++;
-
- /* Issue any pending command to the card if not in ISR */
-// if (!(megaCfg->flag & IN_ISR)) {
mega_runpendq(megaCfg);
-// }
-/*
- * try running the pend queue, irrespective of the driver's context.
- * -cn
- */
+#if LINUX_VERSION_CODE > 0x020024
if ( SCpnt->cmnd[0]==IOCTL_CMD_NEW )
{ /* user data from external user buffer */
char *user_area;
@@ -1905,6 +1863,7 @@
mega_freeSCB(megaCfg, pScb);
}
+#endif
}
megaCfg->flag &= ~IN_QUEUE;
@@ -1959,9 +1918,6 @@
megaCfg->flag |= IN_ABORT;
-#if DEBUG
-printk("ma:fcnt=%d, pcnt=%d, qcnt=%d\n",megaCfg->qFcnt, megaCfg->qPcnt, megaCfg->qCcnt);
-#endif
for(pScb=megaCfg->qPendingH; pScb; pScb=pScb->next) {
if (pScb->SCpnt == SCpnt) {
/* Found an aborting command */
@@ -2013,20 +1969,6 @@
}
}