umc = MBOX_P(uiocp);
- upthru = (mega_passthru *)umc->xferaddr;
+ if (get_user(upthru, (mega_passthru **)&umc->xferaddr))
+ return (-EFAULT);
if( put_user(mc->status, (u8 *)&upthru->scsistatus) )
return (-EFAULT);
umc = (megacmd_t *)uioc_mimd->mbox;
- upthru = (mega_passthru *)umc->xferaddr;
+ if (get_user(upthru, (mega_passthru **)&umc->xferaddr))
+ return (-EFAULT);
if( put_user(mc->status, (u8 *)&upthru->scsistatus) )
return (-EFAULT);
* Wait till all the issued commands are complete and there are no
* commands in the pending queue
*/
- while( atomic_read(&adapter->pend_cmds) > 0 ||
- !list_empty(&adapter->pending_list) ) {
-
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(1*HZ ); /* sleep for 1s */
- }
+ while (atomic_read(&adapter->pend_cmds) > 0 ||
+ !list_empty(&adapter->pending_list))
+ msleep(1000); /* sleep for 1s */
rval = mega_do_del_logdrv(adapter, logdrv);
pci_bus = pdev->bus->number;
pci_dev_func = pdev->devfn;
+
+ if(pdev->vendor == PCI_VENDOR_ID_INTEL) /* The megaraid3 stuff reports the id of the intel
+ part which is not remotely specific to the megaraid */
+ {
+ u16 magic;
+ /* Don't fall over the Compaq management cards using the same PCI identifier */
+ if(pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ &&
+ pdev->subsystem_device == 0xC000)
+ return -ENODEV;
+ /* Now check the magic signature byte */
+ pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic);
+ if(magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
+ return -ENODEV;
+ /* Ok it is probably a megaraid */
+ }
+
+ /*
+ * The megaraid3 stuff reports the ID of the Intel part which is not
+ * remotely specific to the megaraid
+ */
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
+ u16 magic;
+ /*
+ * Don't fall over the Compaq management cards using the same
+ * PCI identifier
+ */
+ if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ &&
+ pdev->subsystem_device == 0xC000)
+ return -ENODEV;
+ /* Now check the magic signature byte */
+ pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic);
+ if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
+ return -ENODEV;
+ /* Ok it is probably a megaraid */
+ }
/*
* For these vendor and device ids, signature offsets are not