Lines Matching refs:Controller
178 static void DAC960_AnnounceDriver(DAC960_Controller_T *Controller) in DAC960_AnnounceDriver() argument
182 DAC960_DriverDate " *****\n", Controller); in DAC960_AnnounceDriver()
184 "<lnz@dandelion.com>\n", Controller); in DAC960_AnnounceDriver()
192 static bool DAC960_Failure(DAC960_Controller_T *Controller, in DAC960_Failure() argument
196 Controller); in DAC960_Failure()
197 if (Controller->IO_Address == 0) in DAC960_Failure()
199 "PCI Address 0x%X\n", Controller, in DAC960_Failure()
200 Controller->Bus, Controller->Device, in DAC960_Failure()
201 Controller->Function, Controller->PCI_Address); in DAC960_Failure()
203 "0x%X PCI Address 0x%X\n", Controller, in DAC960_Failure()
204 Controller->Bus, Controller->Device, in DAC960_Failure()
205 Controller->Function, Controller->IO_Address, in DAC960_Failure()
206 Controller->PCI_Address); in DAC960_Failure()
207 DAC960_Error("%s FAILED - DETACHING\n", Controller, ErrorMessage); in DAC960_Failure()
265 static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller) in DAC960_CreateAuxiliaryStructures() argument
277 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_CreateAuxiliaryStructures()
282 &Controller->PCIDevice->dev, in DAC960_CreateAuxiliaryStructures()
286 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
288 Controller->ScatterGatherPool = ScatterGatherPool; in DAC960_CreateAuxiliaryStructures()
295 &Controller->PCIDevice->dev, in DAC960_CreateAuxiliaryStructures()
299 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
302 &Controller->PCIDevice->dev, sizeof(DAC960_SCSI_RequestSense_T), in DAC960_CreateAuxiliaryStructures()
306 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
309 Controller->ScatterGatherPool = ScatterGatherPool; in DAC960_CreateAuxiliaryStructures()
310 Controller->V2.RequestSensePool = RequestSensePool; in DAC960_CreateAuxiliaryStructures()
312 Controller->CommandAllocationGroupSize = CommandAllocationGroupSize; in DAC960_CreateAuxiliaryStructures()
313 Controller->FreeCommands = NULL; in DAC960_CreateAuxiliaryStructures()
315 CommandIdentifier <= Controller->DriverQueueDepth; in DAC960_CreateAuxiliaryStructures()
322 Controller->DriverQueueDepth - CommandIdentifier + 1; in DAC960_CreateAuxiliaryStructures()
329 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
335 Command->Controller = Controller; in DAC960_CreateAuxiliaryStructures()
336 Command->Next = Controller->FreeCommands; in DAC960_CreateAuxiliaryStructures()
337 Controller->FreeCommands = Command; in DAC960_CreateAuxiliaryStructures()
338 Controller->Commands[CommandIdentifier-1] = Command; in DAC960_CreateAuxiliaryStructures()
342 return DAC960_Failure(Controller, "AUXILIARY STRUCTURE CREATION"); in DAC960_CreateAuxiliaryStructures()
350 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
354 if (Controller->FirmwareType == DAC960_V1_Controller) { in DAC960_CreateAuxiliaryStructures()
380 static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller) in DAC960_DestroyAuxiliaryStructures() argument
383 struct dma_pool *ScatterGatherPool = Controller->ScatterGatherPool; in DAC960_DestroyAuxiliaryStructures()
392 if (Controller->FirmwareType == DAC960_V2_Controller) in DAC960_DestroyAuxiliaryStructures()
393 RequestSensePool = Controller->V2.RequestSensePool; in DAC960_DestroyAuxiliaryStructures()
395 Controller->FreeCommands = NULL; in DAC960_DestroyAuxiliaryStructures()
396 for (i = 0; i < Controller->DriverQueueDepth; i++) in DAC960_DestroyAuxiliaryStructures()
398 DAC960_Command_T *Command = Controller->Commands[i]; in DAC960_DestroyAuxiliaryStructures()
403 if (Controller->FirmwareType == DAC960_V1_Controller) { in DAC960_DestroyAuxiliaryStructures()
420 % Controller->CommandAllocationGroupSize) == 1) { in DAC960_DestroyAuxiliaryStructures()
430 Controller->Commands[i] = NULL; in DAC960_DestroyAuxiliaryStructures()
434 if (Controller->CombinedStatusBuffer != NULL) in DAC960_DestroyAuxiliaryStructures()
436 kfree(Controller->CombinedStatusBuffer); in DAC960_DestroyAuxiliaryStructures()
437 Controller->CombinedStatusBuffer = NULL; in DAC960_DestroyAuxiliaryStructures()
438 Controller->CurrentStatusBuffer = NULL; in DAC960_DestroyAuxiliaryStructures()
442 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_DestroyAuxiliaryStructures()
448 kfree(Controller->V2.LogicalDeviceInformation[i]); in DAC960_DestroyAuxiliaryStructures()
449 Controller->V2.LogicalDeviceInformation[i] = NULL; in DAC960_DestroyAuxiliaryStructures()
454 kfree(Controller->V2.PhysicalDeviceInformation[i]); in DAC960_DestroyAuxiliaryStructures()
455 Controller->V2.PhysicalDeviceInformation[i] = NULL; in DAC960_DestroyAuxiliaryStructures()
456 kfree(Controller->V2.InquiryUnitSerialNumber[i]); in DAC960_DestroyAuxiliaryStructures()
457 Controller->V2.InquiryUnitSerialNumber[i] = NULL; in DAC960_DestroyAuxiliaryStructures()
496 *Controller) in DAC960_AllocateCommand() argument
498 DAC960_Command_T *Command = Controller->FreeCommands; in DAC960_AllocateCommand()
500 Controller->FreeCommands = Command->Next; in DAC960_AllocateCommand()
513 DAC960_Controller_T *Controller = Command->Controller; in DAC960_DeallocateCommand() local
516 Command->Next = Controller->FreeCommands; in DAC960_DeallocateCommand()
517 Controller->FreeCommands = Command; in DAC960_DeallocateCommand()
525 static void DAC960_WaitForCommand(DAC960_Controller_T *Controller) in DAC960_WaitForCommand() argument
527 spin_unlock_irq(&Controller->queue_lock); in DAC960_WaitForCommand()
528 __wait_event(Controller->CommandWaitQueue, Controller->FreeCommands); in DAC960_WaitForCommand()
529 spin_lock_irq(&Controller->queue_lock); in DAC960_WaitForCommand()
538 DAC960_Controller_T *Controller = Command->Controller; in DAC960_GEM_QueueCommand() local
539 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_GEM_QueueCommand()
542 Controller->V2.NextCommandMailbox; in DAC960_GEM_QueueCommand()
547 if (Controller->V2.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_GEM_QueueCommand()
548 Controller->V2.PreviousCommandMailbox2->Words[0] == 0) in DAC960_GEM_QueueCommand()
551 Controller->V2.PreviousCommandMailbox2 = in DAC960_GEM_QueueCommand()
552 Controller->V2.PreviousCommandMailbox1; in DAC960_GEM_QueueCommand()
553 Controller->V2.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_GEM_QueueCommand()
555 if (++NextCommandMailbox > Controller->V2.LastCommandMailbox) in DAC960_GEM_QueueCommand()
556 NextCommandMailbox = Controller->V2.FirstCommandMailbox; in DAC960_GEM_QueueCommand()
558 Controller->V2.NextCommandMailbox = NextCommandMailbox; in DAC960_GEM_QueueCommand()
567 DAC960_Controller_T *Controller = Command->Controller; in DAC960_BA_QueueCommand() local
568 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_BA_QueueCommand()
571 Controller->V2.NextCommandMailbox; in DAC960_BA_QueueCommand()
574 if (Controller->V2.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_BA_QueueCommand()
575 Controller->V2.PreviousCommandMailbox2->Words[0] == 0) in DAC960_BA_QueueCommand()
577 Controller->V2.PreviousCommandMailbox2 = in DAC960_BA_QueueCommand()
578 Controller->V2.PreviousCommandMailbox1; in DAC960_BA_QueueCommand()
579 Controller->V2.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_BA_QueueCommand()
580 if (++NextCommandMailbox > Controller->V2.LastCommandMailbox) in DAC960_BA_QueueCommand()
581 NextCommandMailbox = Controller->V2.FirstCommandMailbox; in DAC960_BA_QueueCommand()
582 Controller->V2.NextCommandMailbox = NextCommandMailbox; in DAC960_BA_QueueCommand()
592 DAC960_Controller_T *Controller = Command->Controller; in DAC960_LP_QueueCommand() local
593 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LP_QueueCommand()
596 Controller->V2.NextCommandMailbox; in DAC960_LP_QueueCommand()
599 if (Controller->V2.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_LP_QueueCommand()
600 Controller->V2.PreviousCommandMailbox2->Words[0] == 0) in DAC960_LP_QueueCommand()
602 Controller->V2.PreviousCommandMailbox2 = in DAC960_LP_QueueCommand()
603 Controller->V2.PreviousCommandMailbox1; in DAC960_LP_QueueCommand()
604 Controller->V2.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_LP_QueueCommand()
605 if (++NextCommandMailbox > Controller->V2.LastCommandMailbox) in DAC960_LP_QueueCommand()
606 NextCommandMailbox = Controller->V2.FirstCommandMailbox; in DAC960_LP_QueueCommand()
607 Controller->V2.NextCommandMailbox = NextCommandMailbox; in DAC960_LP_QueueCommand()
618 DAC960_Controller_T *Controller = Command->Controller; in DAC960_LA_QueueCommandDualMode() local
619 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LA_QueueCommandDualMode()
622 Controller->V1.NextCommandMailbox; in DAC960_LA_QueueCommandDualMode()
625 if (Controller->V1.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_LA_QueueCommandDualMode()
626 Controller->V1.PreviousCommandMailbox2->Words[0] == 0) in DAC960_LA_QueueCommandDualMode()
628 Controller->V1.PreviousCommandMailbox2 = in DAC960_LA_QueueCommandDualMode()
629 Controller->V1.PreviousCommandMailbox1; in DAC960_LA_QueueCommandDualMode()
630 Controller->V1.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_LA_QueueCommandDualMode()
631 if (++NextCommandMailbox > Controller->V1.LastCommandMailbox) in DAC960_LA_QueueCommandDualMode()
632 NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_LA_QueueCommandDualMode()
633 Controller->V1.NextCommandMailbox = NextCommandMailbox; in DAC960_LA_QueueCommandDualMode()
644 DAC960_Controller_T *Controller = Command->Controller; in DAC960_LA_QueueCommandSingleMode() local
645 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LA_QueueCommandSingleMode()
648 Controller->V1.NextCommandMailbox; in DAC960_LA_QueueCommandSingleMode()
651 if (Controller->V1.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_LA_QueueCommandSingleMode()
652 Controller->V1.PreviousCommandMailbox2->Words[0] == 0) in DAC960_LA_QueueCommandSingleMode()
654 Controller->V1.PreviousCommandMailbox2 = in DAC960_LA_QueueCommandSingleMode()
655 Controller->V1.PreviousCommandMailbox1; in DAC960_LA_QueueCommandSingleMode()
656 Controller->V1.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_LA_QueueCommandSingleMode()
657 if (++NextCommandMailbox > Controller->V1.LastCommandMailbox) in DAC960_LA_QueueCommandSingleMode()
658 NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_LA_QueueCommandSingleMode()
659 Controller->V1.NextCommandMailbox = NextCommandMailbox; in DAC960_LA_QueueCommandSingleMode()
670 DAC960_Controller_T *Controller = Command->Controller; in DAC960_PG_QueueCommandDualMode() local
671 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PG_QueueCommandDualMode()
674 Controller->V1.NextCommandMailbox; in DAC960_PG_QueueCommandDualMode()
677 if (Controller->V1.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_PG_QueueCommandDualMode()
678 Controller->V1.PreviousCommandMailbox2->Words[0] == 0) in DAC960_PG_QueueCommandDualMode()
680 Controller->V1.PreviousCommandMailbox2 = in DAC960_PG_QueueCommandDualMode()
681 Controller->V1.PreviousCommandMailbox1; in DAC960_PG_QueueCommandDualMode()
682 Controller->V1.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_PG_QueueCommandDualMode()
683 if (++NextCommandMailbox > Controller->V1.LastCommandMailbox) in DAC960_PG_QueueCommandDualMode()
684 NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_PG_QueueCommandDualMode()
685 Controller->V1.NextCommandMailbox = NextCommandMailbox; in DAC960_PG_QueueCommandDualMode()
696 DAC960_Controller_T *Controller = Command->Controller; in DAC960_PG_QueueCommandSingleMode() local
697 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PG_QueueCommandSingleMode()
700 Controller->V1.NextCommandMailbox; in DAC960_PG_QueueCommandSingleMode()
703 if (Controller->V1.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_PG_QueueCommandSingleMode()
704 Controller->V1.PreviousCommandMailbox2->Words[0] == 0) in DAC960_PG_QueueCommandSingleMode()
706 Controller->V1.PreviousCommandMailbox2 = in DAC960_PG_QueueCommandSingleMode()
707 Controller->V1.PreviousCommandMailbox1; in DAC960_PG_QueueCommandSingleMode()
708 Controller->V1.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_PG_QueueCommandSingleMode()
709 if (++NextCommandMailbox > Controller->V1.LastCommandMailbox) in DAC960_PG_QueueCommandSingleMode()
710 NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_PG_QueueCommandSingleMode()
711 Controller->V1.NextCommandMailbox = NextCommandMailbox; in DAC960_PG_QueueCommandSingleMode()
721 DAC960_Controller_T *Controller = Command->Controller; in DAC960_PD_QueueCommand() local
722 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PD_QueueCommand()
738 DAC960_Controller_T *Controller = Command->Controller; in DAC960_P_QueueCommand() local
739 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_P_QueueCommand()
784 DAC960_Controller_T *Controller = Command->Controller; in DAC960_ExecuteCommand() local
789 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_ExecuteCommand()
791 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_ExecuteCommand()
805 static bool DAC960_V1_ExecuteType3(DAC960_Controller_T *Controller, in DAC960_V1_ExecuteType3() argument
809 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V1_ExecuteType3()
829 static bool DAC960_V1_ExecuteType3B(DAC960_Controller_T *Controller, in DAC960_V1_ExecuteType3B() argument
834 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V1_ExecuteType3B()
855 static bool DAC960_V1_ExecuteType3D(DAC960_Controller_T *Controller, in DAC960_V1_ExecuteType3D() argument
861 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V1_ExecuteType3D()
885 static bool DAC960_V2_GeneralInfo(DAC960_Controller_T *Controller) in DAC960_V2_GeneralInfo() argument
887 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_GeneralInfo()
902 Controller->V2.HealthStatusBufferDMA; in DAC960_V2_GeneralInfo()
923 static bool DAC960_V2_NewControllerInfo(DAC960_Controller_T *Controller) in DAC960_V2_NewControllerInfo() argument
925 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_NewControllerInfo()
941 Controller->V2.NewControllerInformationDMA; in DAC960_V2_NewControllerInfo()
961 static bool DAC960_V2_NewLogicalDeviceInfo(DAC960_Controller_T *Controller, in DAC960_V2_NewLogicalDeviceInfo() argument
964 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_NewLogicalDeviceInfo()
984 Controller->V2.NewLogicalDeviceInformationDMA; in DAC960_V2_NewLogicalDeviceInfo()
1012 static bool DAC960_V2_NewPhysicalDeviceInfo(DAC960_Controller_T *Controller, in DAC960_V2_NewPhysicalDeviceInfo() argument
1017 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_NewPhysicalDeviceInfo()
1038 Controller->V2.NewPhysicalDeviceInformationDMA; in DAC960_V2_NewPhysicalDeviceInfo()
1051 DAC960_Controller_T *Controller, in DAC960_V2_ConstructNewUnitSerialNumber() argument
1076 Controller->V2.NewInquiryUnitSerialNumberDMA; in DAC960_V2_ConstructNewUnitSerialNumber()
1097 static bool DAC960_V2_NewInquiryUnitSerialNumber(DAC960_Controller_T *Controller, in DAC960_V2_NewInquiryUnitSerialNumber() argument
1104 Command = DAC960_AllocateCommand(Controller); in DAC960_V2_NewInquiryUnitSerialNumber()
1109 DAC960_V2_ConstructNewUnitSerialNumber(Controller, CommandMailbox, in DAC960_V2_NewInquiryUnitSerialNumber()
1125 static bool DAC960_V2_DeviceOperation(DAC960_Controller_T *Controller, in DAC960_V2_DeviceOperation() argument
1130 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_DeviceOperation()
1158 *Controller) in DAC960_V1_EnableMemoryMailboxInterface() argument
1160 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_V1_EnableMemoryMailboxInterface()
1161 DAC960_HardwareType_T hw_type = Controller->HardwareType; in DAC960_V1_EnableMemoryMailboxInterface()
1162 struct pci_dev *PCI_Device = Controller->PCIDevice; in DAC960_V1_EnableMemoryMailboxInterface()
1163 struct dma_loaf *DmaPages = &Controller->DmaPages; in DAC960_V1_EnableMemoryMailboxInterface()
1181 if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) in DAC960_V1_EnableMemoryMailboxInterface()
1182 return DAC960_Failure(Controller, "DMA mask out of range"); in DAC960_V1_EnableMemoryMailboxInterface()
1211 Controller->V1.FirstCommandMailbox = CommandMailboxesMemory; in DAC960_V1_EnableMemoryMailboxInterface()
1212 Controller->V1.FirstCommandMailboxDMA = CommandMailboxesMemoryDMA; in DAC960_V1_EnableMemoryMailboxInterface()
1215 Controller->V1.LastCommandMailbox = CommandMailboxesMemory; in DAC960_V1_EnableMemoryMailboxInterface()
1216 Controller->V1.NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_V1_EnableMemoryMailboxInterface()
1217 Controller->V1.PreviousCommandMailbox1 = Controller->V1.LastCommandMailbox; in DAC960_V1_EnableMemoryMailboxInterface()
1218 Controller->V1.PreviousCommandMailbox2 = in DAC960_V1_EnableMemoryMailboxInterface()
1219 Controller->V1.LastCommandMailbox - 1; in DAC960_V1_EnableMemoryMailboxInterface()
1225 Controller->V1.FirstStatusMailbox = StatusMailboxesMemory; in DAC960_V1_EnableMemoryMailboxInterface()
1226 Controller->V1.FirstStatusMailboxDMA = StatusMailboxesMemoryDMA; in DAC960_V1_EnableMemoryMailboxInterface()
1228 Controller->V1.LastStatusMailbox = StatusMailboxesMemory; in DAC960_V1_EnableMemoryMailboxInterface()
1229 Controller->V1.NextStatusMailbox = Controller->V1.FirstStatusMailbox; in DAC960_V1_EnableMemoryMailboxInterface()
1232 Controller->V1.MonitoringDCDB = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1234 &Controller->V1.MonitoringDCDB_DMA); in DAC960_V1_EnableMemoryMailboxInterface()
1236 Controller->V1.NewEnquiry = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1238 &Controller->V1.NewEnquiryDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1240 Controller->V1.NewErrorTable = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1242 &Controller->V1.NewErrorTableDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1244 Controller->V1.EventLogEntry = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1246 &Controller->V1.EventLogEntryDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1248 Controller->V1.RebuildProgress = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1250 &Controller->V1.RebuildProgressDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1252 Controller->V1.NewLogicalDriveInformation = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1254 &Controller->V1.NewLogicalDriveInformationDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1256 Controller->V1.BackgroundInitializationStatus = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1258 &Controller->V1.BackgroundInitializationStatusDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1260 Controller->V1.NewDeviceState = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1262 &Controller->V1.NewDeviceStateDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1264 Controller->V1.NewInquiryStandardData = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1266 &Controller->V1.NewInquiryStandardDataDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1268 Controller->V1.NewInquiryUnitSerialNumber = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1270 &Controller->V1.NewInquiryUnitSerialNumberDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1276 Controller->V1.DualModeMemoryMailboxInterface = true; in DAC960_V1_EnableMemoryMailboxInterface()
1281 Controller->V1.FirstCommandMailboxDMA; in DAC960_V1_EnableMemoryMailboxInterface()
1283 Controller->V1.FirstStatusMailboxDMA; in DAC960_V1_EnableMemoryMailboxInterface()
1287 switch (Controller->HardwareType) in DAC960_V1_EnableMemoryMailboxInterface()
1313 Controller->V1.DualModeMemoryMailboxInterface = false; in DAC960_V1_EnableMemoryMailboxInterface()
1341 Controller->V1.DualModeMemoryMailboxInterface = false; in DAC960_V1_EnableMemoryMailboxInterface()
1345 DAC960_Failure(Controller, "Unknown Controller Type\n"); in DAC960_V1_EnableMemoryMailboxInterface()
1364 *Controller) in DAC960_V2_EnableMemoryMailboxInterface() argument
1366 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_V2_EnableMemoryMailboxInterface()
1367 struct pci_dev *PCI_Device = Controller->PCIDevice; in DAC960_V2_EnableMemoryMailboxInterface()
1368 struct dma_loaf *DmaPages = &Controller->DmaPages; in DAC960_V2_EnableMemoryMailboxInterface()
1383 if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(64)) && in DAC960_V2_EnableMemoryMailboxInterface()
1384 pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) in DAC960_V2_EnableMemoryMailboxInterface()
1385 return DAC960_Failure(Controller, "DMA mask out of range"); in DAC960_V2_EnableMemoryMailboxInterface()
1415 Controller->V2.FirstCommandMailbox = CommandMailboxesMemory; in DAC960_V2_EnableMemoryMailboxInterface()
1416 Controller->V2.FirstCommandMailboxDMA = CommandMailboxesMemoryDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1419 Controller->V2.LastCommandMailbox = CommandMailboxesMemory; in DAC960_V2_EnableMemoryMailboxInterface()
1420 Controller->V2.NextCommandMailbox = Controller->V2.FirstCommandMailbox; in DAC960_V2_EnableMemoryMailboxInterface()
1421 Controller->V2.PreviousCommandMailbox1 = Controller->V2.LastCommandMailbox; in DAC960_V2_EnableMemoryMailboxInterface()
1422 Controller->V2.PreviousCommandMailbox2 = in DAC960_V2_EnableMemoryMailboxInterface()
1423 Controller->V2.LastCommandMailbox - 1; in DAC960_V2_EnableMemoryMailboxInterface()
1429 Controller->V2.FirstStatusMailbox = StatusMailboxesMemory; in DAC960_V2_EnableMemoryMailboxInterface()
1430 Controller->V2.FirstStatusMailboxDMA = StatusMailboxesMemoryDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1432 Controller->V2.LastStatusMailbox = StatusMailboxesMemory; in DAC960_V2_EnableMemoryMailboxInterface()
1433 Controller->V2.NextStatusMailbox = Controller->V2.FirstStatusMailbox; in DAC960_V2_EnableMemoryMailboxInterface()
1435 Controller->V2.HealthStatusBuffer = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1437 &Controller->V2.HealthStatusBufferDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1439 Controller->V2.NewControllerInformation = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1441 &Controller->V2.NewControllerInformationDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1443 Controller->V2.NewLogicalDeviceInformation = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1445 &Controller->V2.NewLogicalDeviceInformationDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1447 Controller->V2.NewPhysicalDeviceInformation = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1449 &Controller->V2.NewPhysicalDeviceInformationDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1451 Controller->V2.NewInquiryUnitSerialNumber = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1453 &Controller->V2.NewInquiryUnitSerialNumberDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1455 Controller->V2.Event = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1457 &Controller->V2.EventDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1459 Controller->V2.PhysicalToLogicalDevice = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1461 &Controller->V2.PhysicalToLogicalDeviceDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1484 Controller->V2.HealthStatusBufferDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1486 Controller->V2.FirstCommandMailboxDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1488 Controller->V2.FirstStatusMailboxDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1489 switch (Controller->HardwareType) in DAC960_V2_EnableMemoryMailboxInterface()
1525 DAC960_Failure(Controller, "Unknown Controller Type\n"); in DAC960_V2_EnableMemoryMailboxInterface()
1541 *Controller) in DAC960_V1_ReadControllerConfiguration() argument
1550 if (!init_dma_loaf(Controller->PCIDevice, &local_dma, in DAC960_V1_ReadControllerConfiguration()
1552 return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION"); in DAC960_V1_ReadControllerConfiguration()
1557 if (!DAC960_V1_ExecuteType3(Controller, DAC960_V1_Enquiry, in DAC960_V1_ReadControllerConfiguration()
1558 Controller->V1.NewEnquiryDMA)) { in DAC960_V1_ReadControllerConfiguration()
1559 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1560 return DAC960_Failure(Controller, "ENQUIRY"); in DAC960_V1_ReadControllerConfiguration()
1562 memcpy(&Controller->V1.Enquiry, Controller->V1.NewEnquiry, in DAC960_V1_ReadControllerConfiguration()
1565 if (!DAC960_V1_ExecuteType3(Controller, DAC960_V1_Enquiry2, Enquiry2DMA)) { in DAC960_V1_ReadControllerConfiguration()
1566 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1567 return DAC960_Failure(Controller, "ENQUIRY2"); in DAC960_V1_ReadControllerConfiguration()
1570 if (!DAC960_V1_ExecuteType3(Controller, DAC960_V1_ReadConfig2, Config2DMA)) { in DAC960_V1_ReadControllerConfiguration()
1571 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1572 return DAC960_Failure(Controller, "READ CONFIG2"); in DAC960_V1_ReadControllerConfiguration()
1575 if (!DAC960_V1_ExecuteType3(Controller, DAC960_V1_GetLogicalDriveInformation, in DAC960_V1_ReadControllerConfiguration()
1576 Controller->V1.NewLogicalDriveInformationDMA)) { in DAC960_V1_ReadControllerConfiguration()
1577 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1578 return DAC960_Failure(Controller, "GET LOGICAL DRIVE INFORMATION"); in DAC960_V1_ReadControllerConfiguration()
1580 memcpy(&Controller->V1.LogicalDriveInformation, in DAC960_V1_ReadControllerConfiguration()
1581 Controller->V1.NewLogicalDriveInformation, in DAC960_V1_ReadControllerConfiguration()
1586 if (!DAC960_V1_ExecuteType3D(Controller, DAC960_V1_GetDeviceState, in DAC960_V1_ReadControllerConfiguration()
1588 Controller->V1.NewDeviceStateDMA)) { in DAC960_V1_ReadControllerConfiguration()
1589 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1590 return DAC960_Failure(Controller, "GET DEVICE STATE"); in DAC960_V1_ReadControllerConfiguration()
1592 memcpy(&Controller->V1.DeviceState[Channel][TargetID], in DAC960_V1_ReadControllerConfiguration()
1593 Controller->V1.NewDeviceState, sizeof(DAC960_V1_DeviceState_T)); in DAC960_V1_ReadControllerConfiguration()
1602 strcpy(Controller->ModelName, "DAC960PU"); in DAC960_V1_ReadControllerConfiguration()
1603 else strcpy(Controller->ModelName, "DAC960PD"); in DAC960_V1_ReadControllerConfiguration()
1606 strcpy(Controller->ModelName, "DAC960PL"); in DAC960_V1_ReadControllerConfiguration()
1609 strcpy(Controller->ModelName, "DAC960PG"); in DAC960_V1_ReadControllerConfiguration()
1612 strcpy(Controller->ModelName, "DAC960PJ"); in DAC960_V1_ReadControllerConfiguration()
1615 strcpy(Controller->ModelName, "DAC960PR"); in DAC960_V1_ReadControllerConfiguration()
1618 strcpy(Controller->ModelName, "DAC960PT"); in DAC960_V1_ReadControllerConfiguration()
1621 strcpy(Controller->ModelName, "DAC960PTL0"); in DAC960_V1_ReadControllerConfiguration()
1624 strcpy(Controller->ModelName, "DAC960PRL"); in DAC960_V1_ReadControllerConfiguration()
1627 strcpy(Controller->ModelName, "DAC960PTL1"); in DAC960_V1_ReadControllerConfiguration()
1630 strcpy(Controller->ModelName, "DAC1164P"); in DAC960_V1_ReadControllerConfiguration()
1633 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1634 return DAC960_Failure(Controller, "MODEL VERIFICATION"); in DAC960_V1_ReadControllerConfiguration()
1636 strcpy(Controller->FullModelName, "Mylex "); in DAC960_V1_ReadControllerConfiguration()
1637 strcat(Controller->FullModelName, Controller->ModelName); in DAC960_V1_ReadControllerConfiguration()
1670 Controller->V1.Enquiry.MajorFirmwareVersion; in DAC960_V1_ReadControllerConfiguration()
1672 Controller->V1.Enquiry.MinorFirmwareVersion; in DAC960_V1_ReadControllerConfiguration()
1676 snprintf(Controller->FirmwareVersion, sizeof(Controller->FirmwareVersion), in DAC960_V1_ReadControllerConfiguration()
1682 if (!((Controller->FirmwareVersion[0] == '5' && in DAC960_V1_ReadControllerConfiguration()
1683 strcmp(Controller->FirmwareVersion, "5.06") >= 0) || in DAC960_V1_ReadControllerConfiguration()
1684 (Controller->FirmwareVersion[0] == '4' && in DAC960_V1_ReadControllerConfiguration()
1685 strcmp(Controller->FirmwareVersion, "4.06") >= 0) || in DAC960_V1_ReadControllerConfiguration()
1686 (Controller->FirmwareVersion[0] == '3' && in DAC960_V1_ReadControllerConfiguration()
1687 strcmp(Controller->FirmwareVersion, "3.51") >= 0) || in DAC960_V1_ReadControllerConfiguration()
1688 (Controller->FirmwareVersion[0] == '2' && in DAC960_V1_ReadControllerConfiguration()
1689 strcmp(Controller->FirmwareVersion, FIRMWARE_27X) >= 0))) in DAC960_V1_ReadControllerConfiguration()
1691 DAC960_Failure(Controller, "FIRMWARE VERSION VERIFICATION"); in DAC960_V1_ReadControllerConfiguration()
1692 DAC960_Error("Firmware Version = '%s'\n", Controller, in DAC960_V1_ReadControllerConfiguration()
1693 Controller->FirmwareVersion); in DAC960_V1_ReadControllerConfiguration()
1694 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1701 Controller->Channels = Enquiry2->ActualChannels; in DAC960_V1_ReadControllerConfiguration()
1702 Controller->Targets = Enquiry2->MaxTargets; in DAC960_V1_ReadControllerConfiguration()
1703 Controller->MemorySize = Enquiry2->MemorySize >> 20; in DAC960_V1_ReadControllerConfiguration()
1704 Controller->V1.SAFTE_EnclosureManagementEnabled = in DAC960_V1_ReadControllerConfiguration()
1713 Controller->ControllerQueueDepth = Controller->V1.Enquiry.MaxCommands; in DAC960_V1_ReadControllerConfiguration()
1714 Controller->DriverQueueDepth = Controller->ControllerQueueDepth - 1; in DAC960_V1_ReadControllerConfiguration()
1715 if (Controller->DriverQueueDepth > DAC960_MaxDriverQueueDepth) in DAC960_V1_ReadControllerConfiguration()
1716 Controller->DriverQueueDepth = DAC960_MaxDriverQueueDepth; in DAC960_V1_ReadControllerConfiguration()
1717 Controller->LogicalDriveCount = in DAC960_V1_ReadControllerConfiguration()
1718 Controller->V1.Enquiry.NumberOfLogicalDrives; in DAC960_V1_ReadControllerConfiguration()
1719 Controller->MaxBlocksPerCommand = Enquiry2->MaxBlocksPerCommand; in DAC960_V1_ReadControllerConfiguration()
1720 Controller->ControllerScatterGatherLimit = Enquiry2->MaxScatterGatherEntries; in DAC960_V1_ReadControllerConfiguration()
1721 Controller->DriverScatterGatherLimit = in DAC960_V1_ReadControllerConfiguration()
1722 Controller->ControllerScatterGatherLimit; in DAC960_V1_ReadControllerConfiguration()
1723 if (Controller->DriverScatterGatherLimit > DAC960_V1_ScatterGatherLimit) in DAC960_V1_ReadControllerConfiguration()
1724 Controller->DriverScatterGatherLimit = DAC960_V1_ScatterGatherLimit; in DAC960_V1_ReadControllerConfiguration()
1728 Controller->V1.StripeSize = Config2->BlocksPerStripe * Config2->BlockFactor in DAC960_V1_ReadControllerConfiguration()
1730 Controller->V1.SegmentSize = Config2->BlocksPerCacheLine * Config2->BlockFactor in DAC960_V1_ReadControllerConfiguration()
1735 Controller->V1.GeometryTranslationHeads = 128; in DAC960_V1_ReadControllerConfiguration()
1736 Controller->V1.GeometryTranslationSectors = 32; in DAC960_V1_ReadControllerConfiguration()
1739 Controller->V1.GeometryTranslationHeads = 255; in DAC960_V1_ReadControllerConfiguration()
1740 Controller->V1.GeometryTranslationSectors = 63; in DAC960_V1_ReadControllerConfiguration()
1743 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1744 return DAC960_Failure(Controller, "CONFIG2 DRIVE GEOMETRY"); in DAC960_V1_ReadControllerConfiguration()
1749 if ((Controller->FirmwareVersion[0] == '4' && in DAC960_V1_ReadControllerConfiguration()
1750 strcmp(Controller->FirmwareVersion, "4.08") >= 0) || in DAC960_V1_ReadControllerConfiguration()
1751 (Controller->FirmwareVersion[0] == '5' && in DAC960_V1_ReadControllerConfiguration()
1752 strcmp(Controller->FirmwareVersion, "5.08") >= 0)) in DAC960_V1_ReadControllerConfiguration()
1754 Controller->V1.BackgroundInitializationStatusSupported = true; in DAC960_V1_ReadControllerConfiguration()
1755 DAC960_V1_ExecuteType3B(Controller, in DAC960_V1_ReadControllerConfiguration()
1757 Controller-> in DAC960_V1_ReadControllerConfiguration()
1759 memcpy(&Controller->V1.LastBackgroundInitializationStatus, in DAC960_V1_ReadControllerConfiguration()
1760 Controller->V1.BackgroundInitializationStatus, in DAC960_V1_ReadControllerConfiguration()
1767 LogicalDriveNumber < Controller->LogicalDriveCount; in DAC960_V1_ReadControllerConfiguration()
1769 if (Controller->V1.LogicalDriveInformation in DAC960_V1_ReadControllerConfiguration()
1772 Controller->LogicalDriveInitiallyAccessible[LogicalDriveNumber] = true; in DAC960_V1_ReadControllerConfiguration()
1773 Controller->V1.LastRebuildStatus = DAC960_V1_NoRebuildOrCheckInProgress; in DAC960_V1_ReadControllerConfiguration()
1774 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1785 *Controller) in DAC960_V2_ReadControllerConfiguration() argument
1788 &Controller->V2.ControllerInformation; in DAC960_V2_ReadControllerConfiguration()
1793 if (!DAC960_V2_NewControllerInfo(Controller)) in DAC960_V2_ReadControllerConfiguration()
1794 return DAC960_Failure(Controller, "GET CONTROLLER INFO"); in DAC960_V2_ReadControllerConfiguration()
1795 memcpy(ControllerInfo, Controller->V2.NewControllerInformation, in DAC960_V2_ReadControllerConfiguration()
1799 if (!DAC960_V2_GeneralInfo(Controller)) in DAC960_V2_ReadControllerConfiguration()
1800 return DAC960_Failure(Controller, "GET HEALTH STATUS"); in DAC960_V2_ReadControllerConfiguration()
1806 if (ModelNameLength > sizeof(Controller->ModelName)-1) in DAC960_V2_ReadControllerConfiguration()
1807 ModelNameLength = sizeof(Controller->ModelName)-1; in DAC960_V2_ReadControllerConfiguration()
1808 memcpy(Controller->ModelName, ControllerInfo->ControllerName, in DAC960_V2_ReadControllerConfiguration()
1811 while (Controller->ModelName[ModelNameLength] == ' ' || in DAC960_V2_ReadControllerConfiguration()
1812 Controller->ModelName[ModelNameLength] == '\0') in DAC960_V2_ReadControllerConfiguration()
1814 Controller->ModelName[++ModelNameLength] = '\0'; in DAC960_V2_ReadControllerConfiguration()
1815 strcpy(Controller->FullModelName, "Mylex "); in DAC960_V2_ReadControllerConfiguration()
1816 strcat(Controller->FullModelName, Controller->ModelName); in DAC960_V2_ReadControllerConfiguration()
1820 sprintf(Controller->FirmwareVersion, "%d.%02d-%02d", in DAC960_V2_ReadControllerConfiguration()
1829 Controller, Controller->FirmwareVersion); in DAC960_V2_ReadControllerConfiguration()
1831 Controller); in DAC960_V2_ReadControllerConfiguration()
1833 Controller); in DAC960_V2_ReadControllerConfiguration()
1838 Controller->Channels = ControllerInfo->NumberOfPhysicalChannelsPresent; in DAC960_V2_ReadControllerConfiguration()
1839 Controller->Targets = in DAC960_V2_ReadControllerConfiguration()
1842 Controller->MemorySize = ControllerInfo->MemorySizeMB; in DAC960_V2_ReadControllerConfiguration()
1850 Controller->ControllerQueueDepth = ControllerInfo->MaximumParallelCommands; in DAC960_V2_ReadControllerConfiguration()
1851 Controller->DriverQueueDepth = Controller->ControllerQueueDepth - 1; in DAC960_V2_ReadControllerConfiguration()
1852 if (Controller->DriverQueueDepth > DAC960_MaxDriverQueueDepth) in DAC960_V2_ReadControllerConfiguration()
1853 Controller->DriverQueueDepth = DAC960_MaxDriverQueueDepth; in DAC960_V2_ReadControllerConfiguration()
1854 Controller->LogicalDriveCount = ControllerInfo->LogicalDevicesPresent; in DAC960_V2_ReadControllerConfiguration()
1855 Controller->MaxBlocksPerCommand = in DAC960_V2_ReadControllerConfiguration()
1857 Controller->ControllerScatterGatherLimit = in DAC960_V2_ReadControllerConfiguration()
1859 Controller->DriverScatterGatherLimit = in DAC960_V2_ReadControllerConfiguration()
1860 Controller->ControllerScatterGatherLimit; in DAC960_V2_ReadControllerConfiguration()
1861 if (Controller->DriverScatterGatherLimit > DAC960_V2_ScatterGatherLimit) in DAC960_V2_ReadControllerConfiguration()
1862 Controller->DriverScatterGatherLimit = DAC960_V2_ScatterGatherLimit; in DAC960_V2_ReadControllerConfiguration()
1869 Controller->V2.NewLogicalDeviceInformation; in DAC960_V2_ReadControllerConfiguration()
1873 if (!DAC960_V2_NewLogicalDeviceInfo(Controller, LogicalDeviceNumber)) in DAC960_V2_ReadControllerConfiguration()
1878 Controller, LogicalDeviceNumber); in DAC960_V2_ReadControllerConfiguration()
1883 Controller, NewLogicalDeviceInfo->DeviceBlockSizeInBytes); in DAC960_V2_ReadControllerConfiguration()
1887 PhysicalDevice.Controller = 0; in DAC960_V2_ReadControllerConfiguration()
1891 Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] = in DAC960_V2_ReadControllerConfiguration()
1895 Controller->LogicalDriveInitiallyAccessible[LogicalDeviceNumber] = true; in DAC960_V2_ReadControllerConfiguration()
1899 return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION"); in DAC960_V2_ReadControllerConfiguration()
1900 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] = in DAC960_V2_ReadControllerConfiguration()
1916 *Controller) in DAC960_ReportControllerConfiguration() argument
1919 Controller, Controller->ModelName); in DAC960_ReportControllerConfiguration()
1921 Controller, Controller->FirmwareVersion, in DAC960_ReportControllerConfiguration()
1922 Controller->Channels, Controller->MemorySize); in DAC960_ReportControllerConfiguration()
1924 Controller, Controller->Bus, in DAC960_ReportControllerConfiguration()
1925 Controller->Device, Controller->Function); in DAC960_ReportControllerConfiguration()
1926 if (Controller->IO_Address == 0) in DAC960_ReportControllerConfiguration()
1927 DAC960_Info("Unassigned\n", Controller); in DAC960_ReportControllerConfiguration()
1928 else DAC960_Info("0x%X\n", Controller, Controller->IO_Address); in DAC960_ReportControllerConfiguration()
1930 Controller, Controller->PCI_Address, in DAC960_ReportControllerConfiguration()
1931 (unsigned long) Controller->BaseAddress, in DAC960_ReportControllerConfiguration()
1932 Controller->IRQ_Channel); in DAC960_ReportControllerConfiguration()
1935 Controller, Controller->ControllerQueueDepth, in DAC960_ReportControllerConfiguration()
1936 Controller->MaxBlocksPerCommand); in DAC960_ReportControllerConfiguration()
1939 Controller, Controller->DriverQueueDepth, in DAC960_ReportControllerConfiguration()
1940 Controller->DriverScatterGatherLimit, in DAC960_ReportControllerConfiguration()
1941 Controller->ControllerScatterGatherLimit); in DAC960_ReportControllerConfiguration()
1942 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_ReportControllerConfiguration()
1945 "BIOS Geometry: %d/%d\n", Controller, in DAC960_ReportControllerConfiguration()
1946 Controller->V1.StripeSize, in DAC960_ReportControllerConfiguration()
1947 Controller->V1.SegmentSize, in DAC960_ReportControllerConfiguration()
1948 Controller->V1.GeometryTranslationHeads, in DAC960_ReportControllerConfiguration()
1949 Controller->V1.GeometryTranslationSectors); in DAC960_ReportControllerConfiguration()
1950 if (Controller->V1.SAFTE_EnclosureManagementEnabled) in DAC960_ReportControllerConfiguration()
1951 DAC960_Info(" SAF-TE Enclosure Management Enabled\n", Controller); in DAC960_ReportControllerConfiguration()
1965 *Controller) in DAC960_V1_ReadDeviceConfiguration()
1982 if (!init_dma_loaf(Controller->PCIDevice, &local_dma, in DAC960_V1_ReadDeviceConfiguration()
1986 return DAC960_Failure(Controller, in DAC960_V1_ReadDeviceConfiguration()
1989 for (Channel = 0; Channel < Controller->Channels; Channel++) { in DAC960_V1_ReadDeviceConfiguration()
2000 for (TargetID = 0; TargetID < Controller->Targets; TargetID++) in DAC960_V1_ReadDeviceConfiguration()
2008 for (Channel = 0; Channel < Controller->Channels; Channel++) in DAC960_V1_ReadDeviceConfiguration()
2013 DAC960_Command_T *Command = Controller->Commands[Channel]; in DAC960_V1_ReadDeviceConfiguration()
2041 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V1_ReadDeviceConfiguration()
2043 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V1_ReadDeviceConfiguration()
2050 for (Channel = 0; Channel < Controller->Channels; Channel++) in DAC960_V1_ReadDeviceConfiguration()
2053 &Controller->V1.InquiryStandardData[Channel][TargetID]; in DAC960_V1_ReadDeviceConfiguration()
2060 &Controller->V1.InquiryUnitSerialNumber[Channel][TargetID]; in DAC960_V1_ReadDeviceConfiguration()
2061 DAC960_Command_T *Command = Controller->Commands[Channel]; in DAC960_V1_ReadDeviceConfiguration()
2086 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V1_ReadDeviceConfiguration()
2088 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V1_ReadDeviceConfiguration()
2100 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadDeviceConfiguration()
2113 *Controller) in DAC960_V2_ReadDeviceConfiguration()
2121 Controller->V2.NewPhysicalDeviceInformation; in DAC960_V2_ReadDeviceConfiguration()
2124 Controller->V2.NewInquiryUnitSerialNumber; in DAC960_V2_ReadDeviceConfiguration()
2127 if (!DAC960_V2_NewPhysicalDeviceInfo(Controller, Channel, TargetID, LogicalUnit)) in DAC960_V2_ReadDeviceConfiguration()
2133 return DAC960_Failure(Controller, "PHYSICAL DEVICE ALLOCATION"); in DAC960_V2_ReadDeviceConfiguration()
2134 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex] = in DAC960_V2_ReadDeviceConfiguration()
2143 return DAC960_Failure(Controller, "SERIAL NUMBER ALLOCATION"); in DAC960_V2_ReadDeviceConfiguration()
2145 Controller->V2.InquiryUnitSerialNumber[PhysicalDeviceIndex] = in DAC960_V2_ReadDeviceConfiguration()
2158 if (!DAC960_V2_NewInquiryUnitSerialNumber(Controller, Channel, TargetID, LogicalUnit)) { in DAC960_V2_ReadDeviceConfiguration()
2237 *Controller) in DAC960_V1_ReportDeviceConfiguration()
2240 DAC960_Info(" Physical Devices:\n", Controller); in DAC960_V1_ReportDeviceConfiguration()
2241 for (Channel = 0; Channel < Controller->Channels; Channel++) in DAC960_V1_ReportDeviceConfiguration()
2242 for (TargetID = 0; TargetID < Controller->Targets; TargetID++) in DAC960_V1_ReportDeviceConfiguration()
2245 &Controller->V1.InquiryStandardData[Channel][TargetID]; in DAC960_V1_ReportDeviceConfiguration()
2247 &Controller->V1.InquiryUnitSerialNumber[Channel][TargetID]; in DAC960_V1_ReportDeviceConfiguration()
2249 &Controller->V1.DeviceState[Channel][TargetID]; in DAC960_V1_ReportDeviceConfiguration()
2251 &Controller->V1.ErrorTable.ErrorTableEntries[Channel][TargetID]; in DAC960_V1_ReportDeviceConfiguration()
2261 Controller, Channel, TargetID, (TargetID < 10 ? " " : ""), in DAC960_V1_ReportDeviceConfiguration()
2264 DAC960_Info(" Serial Number: %s\n", Controller, SerialNumber); in DAC960_V1_ReportDeviceConfiguration()
2268 if (Controller->V1.DeviceResetCount[Channel][TargetID] > 0) in DAC960_V1_ReportDeviceConfiguration()
2270 Controller, in DAC960_V1_ReportDeviceConfiguration()
2280 Controller->V1.DeviceResetCount[Channel][TargetID]); in DAC960_V1_ReportDeviceConfiguration()
2282 DAC960_Info(" Disk Status: %s, %u blocks\n", Controller, in DAC960_V1_ReportDeviceConfiguration()
2298 "Hard: %d, Misc: %d\n", Controller, in DAC960_V1_ReportDeviceConfiguration()
2304 DAC960_Info(" Logical Drives:\n", Controller); in DAC960_V1_ReportDeviceConfiguration()
2306 LogicalDriveNumber < Controller->LogicalDriveCount; in DAC960_V1_ReportDeviceConfiguration()
2310 &Controller->V1.LogicalDriveInformation[LogicalDriveNumber]; in DAC960_V1_ReportDeviceConfiguration()
2312 Controller, Controller->ControllerNumber, LogicalDriveNumber, in DAC960_V1_ReportDeviceConfiguration()
2334 *Controller) in DAC960_V2_ReportDeviceConfiguration()
2337 DAC960_Info(" Physical Devices:\n", Controller); in DAC960_V2_ReportDeviceConfiguration()
2343 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex]; in DAC960_V2_ReportDeviceConfiguration()
2347 Controller->V2.InquiryUnitSerialNumber[PhysicalDeviceIndex]; in DAC960_V2_ReportDeviceConfiguration()
2356 Controller, in DAC960_V2_ReportDeviceConfiguration()
2362 DAC960_Info(" %sAsynchronous\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2366 DAC960_Info(" %sSynchronous at %d MB/sec\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2372 DAC960_Info(" Serial Number: %s\n", Controller, SerialNumber); in DAC960_V2_ReportDeviceConfiguration()
2376 DAC960_Info(" Disk Status: %s, %u blocks\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2412 "Hard: %d, Misc: %d\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2418 "Aborts: %d, Predicted: %d\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2424 DAC960_Info(" Logical Drives:\n", Controller); in DAC960_V2_ReportDeviceConfiguration()
2430 Controller->V2.LogicalDeviceInformation[LogicalDriveNumber]; in DAC960_V2_ReportDeviceConfiguration()
2458 Controller, LogicalDeviceInfo->DriveGeometry); in DAC960_V2_ReportDeviceConfiguration()
2462 Controller, Controller->ControllerNumber, LogicalDriveNumber, in DAC960_V2_ReportDeviceConfiguration()
2472 Controller, in DAC960_V2_ReportDeviceConfiguration()
2481 "Segment Size: N/A\n", Controller); in DAC960_V2_ReportDeviceConfiguration()
2484 "Segment Size: %dKB\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2491 "Segment Size: N/A\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2495 "Segment Size: %dKB\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2499 DAC960_Info(" %s, %s\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2508 "Deferred Write: %d\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2522 static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller) in DAC960_RegisterBlockDevice() argument
2524 int MajorNumber = DAC960_MAJOR + Controller->ControllerNumber; in DAC960_RegisterBlockDevice()
2534 struct gendisk *disk = Controller->disks[n]; in DAC960_RegisterBlockDevice()
2538 RequestQueue = blk_init_queue(DAC960_RequestFunction,&Controller->queue_lock); in DAC960_RegisterBlockDevice()
2543 Controller->RequestQueue[n] = RequestQueue; in DAC960_RegisterBlockDevice()
2544 RequestQueue->queuedata = Controller; in DAC960_RegisterBlockDevice()
2545 blk_queue_max_segments(RequestQueue, Controller->DriverScatterGatherLimit); in DAC960_RegisterBlockDevice()
2546 blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand); in DAC960_RegisterBlockDevice()
2548 sprintf(disk->disk_name, "rd/c%dd%d", Controller->ControllerNumber, n); in DAC960_RegisterBlockDevice()
2565 static void DAC960_UnregisterBlockDevice(DAC960_Controller_T *Controller) in DAC960_UnregisterBlockDevice() argument
2567 int MajorNumber = DAC960_MAJOR + Controller->ControllerNumber; in DAC960_UnregisterBlockDevice()
2572 del_gendisk(Controller->disks[disk]); in DAC960_UnregisterBlockDevice()
2573 blk_cleanup_queue(Controller->RequestQueue[disk]); in DAC960_UnregisterBlockDevice()
2574 Controller->RequestQueue[disk] = NULL; in DAC960_UnregisterBlockDevice()
2588 static void DAC960_ComputeGenericDiskInfo(DAC960_Controller_T *Controller) in DAC960_ComputeGenericDiskInfo() argument
2592 set_capacity(Controller->disks[disk], disk_size(Controller, disk)); in DAC960_ComputeGenericDiskInfo()
2601 static bool DAC960_ReportErrorStatus(DAC960_Controller_T *Controller, in DAC960_ReportErrorStatus() argument
2610 Controller, Parameter1, Parameter0); in DAC960_ReportErrorStatus()
2613 if (Controller->DriveSpinUpMessageDisplayed) break; in DAC960_ReportErrorStatus()
2614 DAC960_Notice("Spinning Up Drives\n", Controller); in DAC960_ReportErrorStatus()
2615 Controller->DriveSpinUpMessageDisplayed = true; in DAC960_ReportErrorStatus()
2618 DAC960_Notice("Configuration Checksum Error\n", Controller); in DAC960_ReportErrorStatus()
2621 DAC960_Notice("Mirror Race Recovery Failed\n", Controller); in DAC960_ReportErrorStatus()
2624 DAC960_Notice("Mirror Race Recovery In Progress\n", Controller); in DAC960_ReportErrorStatus()
2628 Controller, Parameter1, Parameter0); in DAC960_ReportErrorStatus()
2631 DAC960_Notice("Logical Drive Installation Aborted\n", Controller); in DAC960_ReportErrorStatus()
2634 DAC960_Notice("Mirror Race On A Critical Logical Drive\n", Controller); in DAC960_ReportErrorStatus()
2637 DAC960_Notice("New Controller Configuration Found\n", Controller); in DAC960_ReportErrorStatus()
2640 DAC960_Error("Fatal Memory Parity Error for Controller at\n", Controller); in DAC960_ReportErrorStatus()
2644 Controller, ErrorStatus); in DAC960_ReportErrorStatus()
2660 static void DAC960_DetectCleanup(DAC960_Controller_T *Controller) in DAC960_DetectCleanup() argument
2665 free_dma_loaf(Controller->PCIDevice, &Controller->DmaPages); in DAC960_DetectCleanup()
2666 if (Controller->MemoryMappedAddress) { in DAC960_DetectCleanup()
2667 switch(Controller->HardwareType) in DAC960_DetectCleanup()
2670 DAC960_GEM_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2673 DAC960_BA_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2676 DAC960_LP_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2679 DAC960_LA_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2682 DAC960_PG_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2685 DAC960_PD_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2688 DAC960_PD_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2691 iounmap(Controller->MemoryMappedAddress); in DAC960_DetectCleanup()
2693 if (Controller->IRQ_Channel) in DAC960_DetectCleanup()
2694 free_irq(Controller->IRQ_Channel, Controller); in DAC960_DetectCleanup()
2695 if (Controller->IO_Address) in DAC960_DetectCleanup()
2696 release_region(Controller->IO_Address, 0x80); in DAC960_DetectCleanup()
2697 pci_disable_device(Controller->PCIDevice); in DAC960_DetectCleanup()
2698 for (i = 0; (i < DAC960_MaxLogicalDrives) && Controller->disks[i]; i++) in DAC960_DetectCleanup()
2699 put_disk(Controller->disks[i]); in DAC960_DetectCleanup()
2700 DAC960_Controllers[Controller->ControllerNumber] = NULL; in DAC960_DetectCleanup()
2701 kfree(Controller); in DAC960_DetectCleanup()
2719 DAC960_Controller_T *Controller = NULL; in DAC960_DetectController() local
2726 Controller = kzalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC); in DAC960_DetectController()
2727 if (Controller == NULL) { in DAC960_DetectController()
2732 Controller->ControllerNumber = DAC960_ControllerCount; in DAC960_DetectController()
2733 DAC960_Controllers[DAC960_ControllerCount++] = Controller; in DAC960_DetectController()
2734 Controller->Bus = PCI_Device->bus->number; in DAC960_DetectController()
2735 Controller->FirmwareType = privdata->FirmwareType; in DAC960_DetectController()
2736 Controller->HardwareType = privdata->HardwareType; in DAC960_DetectController()
2737 Controller->Device = DeviceFunction >> 3; in DAC960_DetectController()
2738 Controller->Function = DeviceFunction & 0x7; in DAC960_DetectController()
2739 Controller->PCIDevice = PCI_Device; in DAC960_DetectController()
2740 strcpy(Controller->FullModelName, "DAC960"); in DAC960_DetectController()
2745 switch (Controller->HardwareType) in DAC960_DetectController()
2748 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2751 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2754 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2757 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2760 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2763 Controller->IO_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2764 Controller->PCI_Address = pci_resource_start(PCI_Device, 1); in DAC960_DetectController()
2767 Controller->IO_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2768 Controller->PCI_Address = pci_resource_start(PCI_Device, 1); in DAC960_DetectController()
2772 pci_set_drvdata(PCI_Device, (void *)((long)Controller->ControllerNumber)); in DAC960_DetectController()
2774 Controller->disks[i] = alloc_disk(1<<DAC960_MaxPartitionsBits); in DAC960_DetectController()
2775 if (!Controller->disks[i]) in DAC960_DetectController()
2777 Controller->disks[i]->private_data = (void *)((long)i); in DAC960_DetectController()
2779 init_waitqueue_head(&Controller->CommandWaitQueue); in DAC960_DetectController()
2780 init_waitqueue_head(&Controller->HealthStatusWaitQueue); in DAC960_DetectController()
2781 spin_lock_init(&Controller->queue_lock); in DAC960_DetectController()
2782 DAC960_AnnounceDriver(Controller); in DAC960_DetectController()
2788 Controller->MemoryMappedAddress = in DAC960_DetectController()
2789 ioremap_nocache(Controller->PCI_Address & PAGE_MASK, MemoryWindowSize); in DAC960_DetectController()
2790 Controller->BaseAddress = in DAC960_DetectController()
2791 Controller->MemoryMappedAddress + (Controller->PCI_Address & ~PAGE_MASK); in DAC960_DetectController()
2792 if (Controller->MemoryMappedAddress == NULL) in DAC960_DetectController()
2795 "Controller at\n", Controller); in DAC960_DetectController()
2798 BaseAddress = Controller->BaseAddress; in DAC960_DetectController()
2799 switch (Controller->HardwareType) in DAC960_DetectController()
2809 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2814 if (!DAC960_V2_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2817 "for Controller at\n", Controller); in DAC960_DetectController()
2821 Controller->QueueCommand = DAC960_GEM_QueueCommand; in DAC960_DetectController()
2822 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2824 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2826 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2828 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2839 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2844 if (!DAC960_V2_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2847 "for Controller at\n", Controller); in DAC960_DetectController()
2851 Controller->QueueCommand = DAC960_BA_QueueCommand; in DAC960_DetectController()
2852 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2854 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2856 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2858 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2869 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2874 if (!DAC960_V2_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2877 "for Controller at\n", Controller); in DAC960_DetectController()
2881 Controller->QueueCommand = DAC960_LP_QueueCommand; in DAC960_DetectController()
2882 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2884 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2886 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2888 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2899 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2904 if (!DAC960_V1_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2907 "for Controller at\n", Controller); in DAC960_DetectController()
2911 if (Controller->V1.DualModeMemoryMailboxInterface) in DAC960_DetectController()
2912 Controller->QueueCommand = DAC960_LA_QueueCommandDualMode; in DAC960_DetectController()
2913 else Controller->QueueCommand = DAC960_LA_QueueCommandSingleMode; in DAC960_DetectController()
2914 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2916 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2918 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2920 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2931 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2936 if (!DAC960_V1_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2939 "for Controller at\n", Controller); in DAC960_DetectController()
2943 if (Controller->V1.DualModeMemoryMailboxInterface) in DAC960_DetectController()
2944 Controller->QueueCommand = DAC960_PG_QueueCommandDualMode; in DAC960_DetectController()
2945 else Controller->QueueCommand = DAC960_PG_QueueCommandSingleMode; in DAC960_DetectController()
2946 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2948 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2950 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2952 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2956 if (!request_region(Controller->IO_Address, 0x80, in DAC960_DetectController()
2957 Controller->FullModelName)) { in DAC960_DetectController()
2959 Controller, Controller->IO_Address); in DAC960_DetectController()
2969 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2974 if (!DAC960_V1_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2977 "for Controller at\n", Controller); in DAC960_DetectController()
2981 Controller->QueueCommand = DAC960_PD_QueueCommand; in DAC960_DetectController()
2982 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2984 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2986 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2988 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2992 if (!request_region(Controller->IO_Address, 0x80, in DAC960_DetectController()
2993 Controller->FullModelName)){ in DAC960_DetectController()
2995 Controller, Controller->IO_Address); in DAC960_DetectController()
3005 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
3010 if (!DAC960_V1_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
3013 "for Controller at\n", Controller); in DAC960_DetectController()
3017 Controller->QueueCommand = DAC960_P_QueueCommand; in DAC960_DetectController()
3018 Controller->ReadControllerConfiguration = in DAC960_DetectController()
3020 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
3022 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
3024 Controller->QueueReadWriteCommand = in DAC960_DetectController()
3033 Controller->FullModelName, Controller) < 0) in DAC960_DetectController()
3036 Controller, Controller->IRQ_Channel); in DAC960_DetectController()
3039 Controller->IRQ_Channel = IRQ_Channel; in DAC960_DetectController()
3040 Controller->InitialCommand.CommandIdentifier = 1; in DAC960_DetectController()
3041 Controller->InitialCommand.Controller = Controller; in DAC960_DetectController()
3042 Controller->Commands[0] = &Controller->InitialCommand; in DAC960_DetectController()
3043 Controller->FreeCommands = &Controller->InitialCommand; in DAC960_DetectController()
3044 return Controller; in DAC960_DetectController()
3047 if (Controller->IO_Address == 0) in DAC960_DetectController()
3049 "PCI Address 0x%X\n", Controller, in DAC960_DetectController()
3050 Controller->Bus, Controller->Device, in DAC960_DetectController()
3051 Controller->Function, Controller->PCI_Address); in DAC960_DetectController()
3054 "0x%X PCI Address 0x%X\n", Controller, in DAC960_DetectController()
3055 Controller->Bus, Controller->Device, in DAC960_DetectController()
3056 Controller->Function, Controller->IO_Address, in DAC960_DetectController()
3057 Controller->PCI_Address); in DAC960_DetectController()
3058 DAC960_DetectCleanup(Controller); in DAC960_DetectController()
3068 DAC960_InitializeController(DAC960_Controller_T *Controller) in DAC960_InitializeController() argument
3070 if (DAC960_ReadControllerConfiguration(Controller) && in DAC960_InitializeController()
3071 DAC960_ReportControllerConfiguration(Controller) && in DAC960_InitializeController()
3072 DAC960_CreateAuxiliaryStructures(Controller) && in DAC960_InitializeController()
3073 DAC960_ReadDeviceConfiguration(Controller) && in DAC960_InitializeController()
3074 DAC960_ReportDeviceConfiguration(Controller) && in DAC960_InitializeController()
3075 DAC960_RegisterBlockDevice(Controller)) in DAC960_InitializeController()
3080 timer_setup(&Controller->MonitoringTimer, in DAC960_InitializeController()
3082 Controller->MonitoringTimer.expires = in DAC960_InitializeController()
3084 add_timer(&Controller->MonitoringTimer); in DAC960_InitializeController()
3085 Controller->ControllerInitialized = true; in DAC960_InitializeController()
3096 static void DAC960_FinalizeController(DAC960_Controller_T *Controller) in DAC960_FinalizeController() argument
3098 if (Controller->ControllerInitialized) in DAC960_FinalizeController()
3119 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_FinalizeController()
3120 Controller->ShutdownMonitoringTimer = 1; in DAC960_FinalizeController()
3121 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_FinalizeController()
3123 del_timer_sync(&Controller->MonitoringTimer); in DAC960_FinalizeController()
3124 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_FinalizeController()
3126 DAC960_Notice("Flushing Cache...", Controller); in DAC960_FinalizeController()
3127 DAC960_V1_ExecuteType3(Controller, DAC960_V1_Flush, 0); in DAC960_FinalizeController()
3128 DAC960_Notice("done\n", Controller); in DAC960_FinalizeController()
3130 if (Controller->HardwareType == DAC960_PD_Controller) in DAC960_FinalizeController()
3131 release_region(Controller->IO_Address, 0x80); in DAC960_FinalizeController()
3135 DAC960_Notice("Flushing Cache...", Controller); in DAC960_FinalizeController()
3136 DAC960_V2_DeviceOperation(Controller, DAC960_V2_PauseDevice, in DAC960_FinalizeController()
3138 DAC960_Notice("done\n", Controller); in DAC960_FinalizeController()
3141 DAC960_UnregisterBlockDevice(Controller); in DAC960_FinalizeController()
3142 DAC960_DestroyAuxiliaryStructures(Controller); in DAC960_FinalizeController()
3143 DAC960_DestroyProcEntries(Controller); in DAC960_FinalizeController()
3144 DAC960_DetectCleanup(Controller); in DAC960_FinalizeController()
3157 DAC960_Controller_T *Controller; in DAC960_Probe() local
3167 Controller = DAC960_DetectController(dev, entry); in DAC960_Probe()
3168 if (!Controller) in DAC960_Probe()
3171 if (!DAC960_InitializeController(Controller)) { in DAC960_Probe()
3172 DAC960_FinalizeController(Controller); in DAC960_Probe()
3177 set_capacity(Controller->disks[disk], disk_size(Controller, disk)); in DAC960_Probe()
3178 add_disk(Controller->disks[disk]); in DAC960_Probe()
3180 DAC960_CreateProcEntries(Controller); in DAC960_Probe()
3192 DAC960_Controller_T *Controller = DAC960_Controllers[Controller_Number]; in DAC960_Remove() local
3193 if (Controller != NULL) in DAC960_Remove()
3194 DAC960_FinalizeController(Controller); in DAC960_Remove()
3205 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V1_QueueReadWriteCommand() local
3260 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V2_QueueReadWriteCommand() local
3273 Controller->V2.LogicalDriveToVirtualDevice[Command->LogicalDriveNumber]; in DAC960_V2_QueueReadWriteCommand()
3327 static int DAC960_process_queue(DAC960_Controller_T *Controller, struct request_queue *req_q) in DAC960_process_queue() argument
3337 Command = DAC960_AllocateCommand(Controller); in DAC960_process_queue()
3357 Command->SegmentCount = pci_map_sg(Controller->PCIDevice, Command->cmd_sglist, in DAC960_process_queue()
3418 DAC960_Controller_T *Controller = Command->Controller; in DAC960_queue_partial_rw() local
3420 struct request_queue *req_q = Controller->RequestQueue[Command->LogicalDriveNumber]; in DAC960_queue_partial_rw()
3435 (void)pci_map_sg(Controller->PCIDevice, Command->cmd_sglist, 1, Command->DmaDirection); in DAC960_queue_partial_rw()
3469 pci_unmap_sg(Command->Controller->PCIDevice, Command->cmd_sglist, in DAC960_ProcessCompletedRequest()
3489 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V1_ReadWriteError() local
3510 Controller, CommandName); in DAC960_V1_ReadWriteError()
3514 Controller, CommandName); in DAC960_V1_ReadWriteError()
3518 "on %s:\n", Controller, CommandName); in DAC960_V1_ReadWriteError()
3521 DAC960_Error("Bad Data Encountered on %s:\n", Controller, CommandName); in DAC960_V1_ReadWriteError()
3525 Controller, Command->V1.CommandStatus, CommandName); in DAC960_V1_ReadWriteError()
3529 Controller, Controller->ControllerNumber, in DAC960_V1_ReadWriteError()
3542 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V1_ProcessCompletedCommand() local
3614 if (Controller->ShutdownMonitoringTimer) in DAC960_V1_ProcessCompletedCommand()
3618 DAC960_V1_Enquiry_T *OldEnquiry = &Controller->V1.Enquiry; in DAC960_V1_ProcessCompletedCommand()
3619 DAC960_V1_Enquiry_T *NewEnquiry = Controller->V1.NewEnquiry; in DAC960_V1_ProcessCompletedCommand()
3624 if (NewEnquiry->NumberOfLogicalDrives > Controller->LogicalDriveCount) in DAC960_V1_ProcessCompletedCommand()
3626 int LogicalDriveNumber = Controller->LogicalDriveCount - 1; in DAC960_V1_ProcessCompletedCommand()
3629 "Now Exists\n", Controller, in DAC960_V1_ProcessCompletedCommand()
3631 Controller->ControllerNumber, in DAC960_V1_ProcessCompletedCommand()
3633 Controller->LogicalDriveCount = NewEnquiry->NumberOfLogicalDrives; in DAC960_V1_ProcessCompletedCommand()
3634 DAC960_ComputeGenericDiskInfo(Controller); in DAC960_V1_ProcessCompletedCommand()
3636 if (NewEnquiry->NumberOfLogicalDrives < Controller->LogicalDriveCount) in DAC960_V1_ProcessCompletedCommand()
3639 while (++LogicalDriveNumber < Controller->LogicalDriveCount) in DAC960_V1_ProcessCompletedCommand()
3641 "No Longer Exists\n", Controller, in DAC960_V1_ProcessCompletedCommand()
3643 Controller->ControllerNumber, in DAC960_V1_ProcessCompletedCommand()
3645 Controller->LogicalDriveCount = NewEnquiry->NumberOfLogicalDrives; in DAC960_V1_ProcessCompletedCommand()
3646 DAC960_ComputeGenericDiskInfo(Controller); in DAC960_V1_ProcessCompletedCommand()
3650 DAC960_Critical("Deferred Write Error Flag is now %s\n", Controller, in DAC960_V1_ProcessCompletedCommand()
3663 Controller->MonitoringTimerCount == 0 || in DAC960_V1_ProcessCompletedCommand()
3664 time_after_eq(jiffies, Controller->SecondaryMonitoringTime in DAC960_V1_ProcessCompletedCommand()
3667 Controller->V1.NeedLogicalDriveInformation = true; in DAC960_V1_ProcessCompletedCommand()
3668 Controller->V1.NewEventLogSequenceNumber = in DAC960_V1_ProcessCompletedCommand()
3670 Controller->V1.NeedErrorTableInformation = true; in DAC960_V1_ProcessCompletedCommand()
3671 Controller->V1.NeedDeviceStateInformation = true; in DAC960_V1_ProcessCompletedCommand()
3672 Controller->V1.StartDeviceStateScan = true; in DAC960_V1_ProcessCompletedCommand()
3673 Controller->V1.NeedBackgroundInitializationStatus = in DAC960_V1_ProcessCompletedCommand()
3674 Controller->V1.BackgroundInitializationStatusSupported; in DAC960_V1_ProcessCompletedCommand()
3675 Controller->SecondaryMonitoringTime = jiffies; in DAC960_V1_ProcessCompletedCommand()
3683 Controller->V1.NeedRebuildProgress = true; in DAC960_V1_ProcessCompletedCommand()
3684 Controller->V1.RebuildProgressFirst = in DAC960_V1_ProcessCompletedCommand()
3693 Controller); in DAC960_V1_ProcessCompletedCommand()
3699 Controller->V1.NeedConsistencyCheckProgress = true; in DAC960_V1_ProcessCompletedCommand()
3703 Controller); in DAC960_V1_ProcessCompletedCommand()
3707 "Physical Device Failed\n", Controller); in DAC960_V1_ProcessCompletedCommand()
3711 "Logical Drive Failed\n", Controller); in DAC960_V1_ProcessCompletedCommand()
3715 Controller); in DAC960_V1_ProcessCompletedCommand()
3719 Controller); in DAC960_V1_ProcessCompletedCommand()
3724 Controller->V1.NeedConsistencyCheckProgress = true; in DAC960_V1_ProcessCompletedCommand()
3725 Controller->MonitoringAlertMode = in DAC960_V1_ProcessCompletedCommand()
3731 Controller->V1.PendingRebuildFlag = NewEnquiry->RebuildFlag; in DAC960_V1_ProcessCompletedCommand()
3732 Controller->V1.RebuildFlagPending = true; in DAC960_V1_ProcessCompletedCommand()
3734 memcpy(&Controller->V1.Enquiry, &Controller->V1.NewEnquiry, in DAC960_V1_ProcessCompletedCommand()
3755 Controller->V1.EventLogEntry; in DAC960_V1_ProcessCompletedCommand()
3757 Controller->V1.OldEventLogSequenceNumber) in DAC960_V1_ProcessCompletedCommand()
3768 DAC960_Critical("Physical Device %d:%d %s\n", Controller, in DAC960_V1_ProcessCompletedCommand()
3776 if (Controller->MonitoringTimerCount > 0) in DAC960_V1_ProcessCompletedCommand()
3777 Controller->V1.DeviceResetCount[EventLogEntry->Channel] in DAC960_V1_ProcessCompletedCommand()
3788 Controller, in DAC960_V1_ProcessCompletedCommand()
3797 Controller, in DAC960_V1_ProcessCompletedCommand()
3810 Controller->V1.OldEventLogSequenceNumber++; in DAC960_V1_ProcessCompletedCommand()
3814 DAC960_V1_ErrorTable_T *OldErrorTable = &Controller->V1.ErrorTable; in DAC960_V1_ProcessCompletedCommand()
3815 DAC960_V1_ErrorTable_T *NewErrorTable = Controller->V1.NewErrorTable; in DAC960_V1_ProcessCompletedCommand()
3817 for (Channel = 0; Channel < Controller->Channels; Channel++) in DAC960_V1_ProcessCompletedCommand()
3818 for (TargetID = 0; TargetID < Controller->Targets; TargetID++) in DAC960_V1_ProcessCompletedCommand()
3835 Controller, Channel, TargetID, in DAC960_V1_ProcessCompletedCommand()
3841 memcpy(&Controller->V1.ErrorTable, Controller->V1.NewErrorTable, in DAC960_V1_ProcessCompletedCommand()
3847 &Controller->V1.DeviceState[Controller->V1.DeviceStateChannel] in DAC960_V1_ProcessCompletedCommand()
3848 [Controller->V1.DeviceStateTargetID]; in DAC960_V1_ProcessCompletedCommand()
3850 Controller->V1.NewDeviceState; in DAC960_V1_ProcessCompletedCommand()
3852 DAC960_Critical("Physical Device %d:%d is now %s\n", Controller, in DAC960_V1_ProcessCompletedCommand()
3853 Controller->V1.DeviceStateChannel, in DAC960_V1_ProcessCompletedCommand()
3854 Controller->V1.DeviceStateTargetID, in DAC960_V1_ProcessCompletedCommand()
3867 Controller->V1.NeedDeviceInquiryInformation = true; in DAC960_V1_ProcessCompletedCommand()
3868 Controller->V1.NeedDeviceSerialNumberInformation = true; in DAC960_V1_ProcessCompletedCommand()
3869 Controller->V1.DeviceResetCount in DAC960_V1_ProcessCompletedCommand()
3870 [Controller->V1.DeviceStateChannel] in DAC960_V1_ProcessCompletedCommand()
3871 [Controller->V1.DeviceStateTargetID] = 0; in DAC960_V1_ProcessCompletedCommand()
3880 LogicalDriveNumber < Controller->LogicalDriveCount; in DAC960_V1_ProcessCompletedCommand()
3884 &Controller->V1.LogicalDriveInformation[LogicalDriveNumber]; in DAC960_V1_ProcessCompletedCommand()
3886 &(*Controller->V1.NewLogicalDriveInformation)[LogicalDriveNumber]; in DAC960_V1_ProcessCompletedCommand()
3890 "is now %s\n", Controller, in DAC960_V1_ProcessCompletedCommand()
3892 Controller->ControllerNumber, in DAC960_V1_ProcessCompletedCommand()
3903 "is now %s\n", Controller, in DAC960_V1_ProcessCompletedCommand()
3905 Controller->ControllerNumber, in DAC960_V1_ProcessCompletedCommand()
3910 memcpy(&Controller->V1.LogicalDriveInformation, in DAC960_V1_ProcessCompletedCommand()
3911 Controller->V1.NewLogicalDriveInformation, in DAC960_V1_ProcessCompletedCommand()
3917 Controller->V1.RebuildProgress->LogicalDriveNumber; in DAC960_V1_ProcessCompletedCommand()
3919 Controller->V1.RebuildProgress->LogicalDriveSize; in DAC960_V1_ProcessCompletedCommand()
3921 LogicalDriveSize - Controller->V1.RebuildProgress->RemainingBlocks; in DAC960_V1_ProcessCompletedCommand()
3923 Controller->V1.LastRebuildStatus == DAC960_V1_NormalCompletion) in DAC960_V1_ProcessCompletedCommand()
3928 Controller->EphemeralProgressMessage = true; in DAC960_V1_ProcessCompletedCommand()
3932 Controller, LogicalDriveNumber, in DAC960_V1_ProcessCompletedCommand()
3933 Controller->ControllerNumber, in DAC960_V1_ProcessCompletedCommand()
3937 Controller->EphemeralProgressMessage = false; in DAC960_V1_ProcessCompletedCommand()
3941 "Logical Drive Failure\n", Controller); in DAC960_V1_ProcessCompletedCommand()
3945 "Bad Blocks on Other Drives\n", Controller); in DAC960_V1_ProcessCompletedCommand()
3949 "Failure of Drive Being Rebuilt\n", Controller); in DAC960_V1_ProcessCompletedCommand()
3954 DAC960_Progress("Rebuild Completed Successfully\n", Controller); in DAC960_V1_ProcessCompletedCommand()
3957 DAC960_Progress("Rebuild Successfully Terminated\n", Controller); in DAC960_V1_ProcessCompletedCommand()
3960 Controller->V1.LastRebuildStatus = CommandStatus; in DAC960_V1_ProcessCompletedCommand()
3962 Controller->V1.RebuildStatusPending) in DAC960_V1_ProcessCompletedCommand()
3964 Command->V1.CommandStatus = Controller->V1.PendingRebuildStatus; in DAC960_V1_ProcessCompletedCommand()
3965 Controller->V1.RebuildStatusPending = false; in DAC960_V1_ProcessCompletedCommand()
3971 Controller->V1.PendingRebuildStatus = CommandStatus; in DAC960_V1_ProcessCompletedCommand()
3972 Controller->V1.RebuildStatusPending = true; in DAC960_V1_ProcessCompletedCommand()
3978 Controller->V1.RebuildProgress->LogicalDriveNumber; in DAC960_V1_ProcessCompletedCommand()
3980 Controller->V1.RebuildProgress->LogicalDriveSize; in DAC960_V1_ProcessCompletedCommand()
3982 LogicalDriveSize - Controller->V1.RebuildProgress->RemainingBlocks; in DAC960_V1_ProcessCompletedCommand()
3985 Controller->EphemeralProgressMessage = true; in DAC960_V1_ProcessCompletedCommand()
3989 Controller, LogicalDriveNumber, in DAC960_V1_ProcessCompletedCommand()
3990 Controller->ControllerNumber, in DAC960_V1_ProcessCompletedCommand()
3994 Controller->EphemeralProgressMessage = false; in DAC960_V1_ProcessCompletedCommand()
4000 Controller->V1.BackgroundInitializationStatus->LogicalDriveNumber; in DAC960_V1_ProcessCompletedCommand()
4002 Controller->V1.BackgroundInitializationStatus->LogicalDriveSize; in DAC960_V1_ProcessCompletedCommand()
4004 Controller->V1.BackgroundInitializationStatus->BlocksCompleted; in DAC960_V1_ProcessCompletedCommand()
4008 switch (Controller->V1.BackgroundInitializationStatus->Status) in DAC960_V1_ProcessCompletedCommand()
4014 Controller); in DAC960_V1_ProcessCompletedCommand()
4018 Controller->V1.LastBackgroundInitializationStatus. in DAC960_V1_ProcessCompletedCommand()
4021 Controller->V1.LastBackgroundInitializationStatus. in DAC960_V1_ProcessCompletedCommand()
4024 Controller->EphemeralProgressMessage = true; in DAC960_V1_ProcessCompletedCommand()
4028 Controller, LogicalDriveNumber, in DAC960_V1_ProcessCompletedCommand()
4029 Controller->ControllerNumber, in DAC960_V1_ProcessCompletedCommand()
4033 Controller->EphemeralProgressMessage = false; in DAC960_V1_ProcessCompletedCommand()
4037 Controller); in DAC960_V1_ProcessCompletedCommand()
4041 Controller); in DAC960_V1_ProcessCompletedCommand()
4044 memcpy(&Controller->V1.LastBackgroundInitializationStatus, in DAC960_V1_ProcessCompletedCommand()
4045 Controller->V1.BackgroundInitializationStatus, in DAC960_V1_ProcessCompletedCommand()
4049 if (Controller->V1.BackgroundInitializationStatus->Status == in DAC960_V1_ProcessCompletedCommand()
4052 "Completed Successfully\n", Controller); in DAC960_V1_ProcessCompletedCommand()
4053 Controller->V1.BackgroundInitializationStatus->Status = in DAC960_V1_ProcessCompletedCommand()
4057 if (Controller->V1.BackgroundInitializationStatus->Status == in DAC960_V1_ProcessCompletedCommand()
4060 Controller); in DAC960_V1_ProcessCompletedCommand()
4061 Controller->V1.BackgroundInitializationStatus->Status = in DAC960_V1_ProcessCompletedCommand()
4083 if (Controller->V1.NeedDeviceInquiryInformation) in DAC960_V1_ProcessCompletedCommand()
4086 &Controller->V1.InquiryStandardData in DAC960_V1_ProcessCompletedCommand()
4087 [Controller->V1.DeviceStateChannel] in DAC960_V1_ProcessCompletedCommand()
4088 [Controller->V1.DeviceStateTargetID]; in DAC960_V1_ProcessCompletedCommand()
4097 Controller->V1.NewInquiryStandardData, in DAC960_V1_ProcessCompletedCommand()
4099 Controller->V1.NeedDeviceInquiryInformation = false; in DAC960_V1_ProcessCompletedCommand()
4101 else if (Controller->V1.NeedDeviceSerialNumberInformation) in DAC960_V1_ProcessCompletedCommand()
4104 &Controller->V1.InquiryUnitSerialNumber in DAC960_V1_ProcessCompletedCommand()
4105 [Controller->V1.DeviceStateChannel] in DAC960_V1_ProcessCompletedCommand()
4106 [Controller->V1.DeviceStateTargetID]; in DAC960_V1_ProcessCompletedCommand()
4115 Controller->V1.NewInquiryUnitSerialNumber, in DAC960_V1_ProcessCompletedCommand()
4117 Controller->V1.NeedDeviceSerialNumberInformation = false; in DAC960_V1_ProcessCompletedCommand()
4123 if (Controller->V1.NewEventLogSequenceNumber in DAC960_V1_ProcessCompletedCommand()
4124 - Controller->V1.OldEventLogSequenceNumber > 0) in DAC960_V1_ProcessCompletedCommand()
4132 Controller->V1.OldEventLogSequenceNumber; in DAC960_V1_ProcessCompletedCommand()
4134 Controller->V1.EventLogEntryDMA; in DAC960_V1_ProcessCompletedCommand()
4138 if (Controller->V1.NeedErrorTableInformation) in DAC960_V1_ProcessCompletedCommand()
4140 Controller->V1.NeedErrorTableInformation = false; in DAC960_V1_ProcessCompletedCommand()
4144 Controller->V1.NewErrorTableDMA; in DAC960_V1_ProcessCompletedCommand()
4148 if (Controller->V1.NeedRebuildProgress && in DAC960_V1_ProcessCompletedCommand()
4149 Controller->V1.RebuildProgressFirst) in DAC960_V1_ProcessCompletedCommand()
4151 Controller->V1.NeedRebuildProgress = false; in DAC960_V1_ProcessCompletedCommand()
4155 Controller->V1.RebuildProgressDMA; in DAC960_V1_ProcessCompletedCommand()
4159 if (Controller->V1.NeedDeviceStateInformation) in DAC960_V1_ProcessCompletedCommand()
4161 if (Controller->V1.NeedDeviceInquiryInformation) in DAC960_V1_ProcessCompletedCommand()
4163 DAC960_V1_DCDB_T *DCDB = Controller->V1.MonitoringDCDB; in DAC960_V1_ProcessCompletedCommand()
4164 dma_addr_t DCDB_DMA = Controller->V1.MonitoringDCDB_DMA; in DAC960_V1_ProcessCompletedCommand()
4167 Controller->V1.NewInquiryStandardDataDMA; in DAC960_V1_ProcessCompletedCommand()
4171 DCDB->Channel = Controller->V1.DeviceStateChannel; in DAC960_V1_ProcessCompletedCommand()
4172 DCDB->TargetID = Controller->V1.DeviceStateTargetID; in DAC960_V1_ProcessCompletedCommand()
4192 if (Controller->V1.NeedDeviceSerialNumberInformation) in DAC960_V1_ProcessCompletedCommand()
4194 DAC960_V1_DCDB_T *DCDB = Controller->V1.MonitoringDCDB; in DAC960_V1_ProcessCompletedCommand()
4195 dma_addr_t DCDB_DMA = Controller->V1.MonitoringDCDB_DMA; in DAC960_V1_ProcessCompletedCommand()
4197 Controller->V1.NewInquiryUnitSerialNumberDMA; in DAC960_V1_ProcessCompletedCommand()
4201 DCDB->Channel = Controller->V1.DeviceStateChannel; in DAC960_V1_ProcessCompletedCommand()
4202 DCDB->TargetID = Controller->V1.DeviceStateTargetID; in DAC960_V1_ProcessCompletedCommand()
4223 if (Controller->V1.StartDeviceStateScan) in DAC960_V1_ProcessCompletedCommand()
4225 Controller->V1.DeviceStateChannel = 0; in DAC960_V1_ProcessCompletedCommand()
4226 Controller->V1.DeviceStateTargetID = 0; in DAC960_V1_ProcessCompletedCommand()
4227 Controller->V1.StartDeviceStateScan = false; in DAC960_V1_ProcessCompletedCommand()
4229 else if (++Controller->V1.DeviceStateTargetID == Controller->Targets) in DAC960_V1_ProcessCompletedCommand()
4231 Controller->V1.DeviceStateChannel++; in DAC960_V1_ProcessCompletedCommand()
4232 Controller->V1.DeviceStateTargetID = 0; in DAC960_V1_ProcessCompletedCommand()
4234 if (Controller->V1.DeviceStateChannel < Controller->Channels) in DAC960_V1_ProcessCompletedCommand()
4236 Controller->V1.NewDeviceState->DeviceState = in DAC960_V1_ProcessCompletedCommand()
4241 Controller->V1.DeviceStateChannel; in DAC960_V1_ProcessCompletedCommand()
4243 Controller->V1.DeviceStateTargetID; in DAC960_V1_ProcessCompletedCommand()
4245 Controller->V1.NewDeviceStateDMA; in DAC960_V1_ProcessCompletedCommand()
4249 Controller->V1.NeedDeviceStateInformation = false; in DAC960_V1_ProcessCompletedCommand()
4251 if (Controller->V1.NeedLogicalDriveInformation) in DAC960_V1_ProcessCompletedCommand()
4253 Controller->V1.NeedLogicalDriveInformation = false; in DAC960_V1_ProcessCompletedCommand()
4257 Controller->V1.NewLogicalDriveInformationDMA; in DAC960_V1_ProcessCompletedCommand()
4261 if (Controller->V1.NeedRebuildProgress) in DAC960_V1_ProcessCompletedCommand()
4263 Controller->V1.NeedRebuildProgress = false; in DAC960_V1_ProcessCompletedCommand()
4267 Controller->V1.RebuildProgressDMA; in DAC960_V1_ProcessCompletedCommand()
4271 if (Controller->V1.NeedConsistencyCheckProgress) in DAC960_V1_ProcessCompletedCommand()
4273 Controller->V1.NeedConsistencyCheckProgress = false; in DAC960_V1_ProcessCompletedCommand()
4277 Controller->V1.RebuildProgressDMA; in DAC960_V1_ProcessCompletedCommand()
4281 if (Controller->V1.NeedBackgroundInitializationStatus) in DAC960_V1_ProcessCompletedCommand()
4283 Controller->V1.NeedBackgroundInitializationStatus = false; in DAC960_V1_ProcessCompletedCommand()
4288 Controller->V1.BackgroundInitializationStatusDMA; in DAC960_V1_ProcessCompletedCommand()
4292 Controller->MonitoringTimerCount++; in DAC960_V1_ProcessCompletedCommand()
4293 Controller->MonitoringTimer.expires = in DAC960_V1_ProcessCompletedCommand()
4295 add_timer(&Controller->MonitoringTimer); in DAC960_V1_ProcessCompletedCommand()
4309 Controller->V1.DirectCommandActive[KernelCommand->DCDB->Channel] in DAC960_V1_ProcessCompletedCommand()
4321 if (Controller->MonitoringCommandDeferred) in DAC960_V1_ProcessCompletedCommand()
4323 Controller->MonitoringCommandDeferred = false; in DAC960_V1_ProcessCompletedCommand()
4334 wake_up(&Controller->CommandWaitQueue); in DAC960_V1_ProcessCompletedCommand()
4345 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V2_ReadWriteError() local
4372 DAC960_Error("Error Condition %s on %s:\n", Controller, in DAC960_V2_ReadWriteError()
4375 Controller, Controller->ControllerNumber, in DAC960_V2_ReadWriteError()
4386 static void DAC960_V2_ReportEvent(DAC960_Controller_T *Controller, in DAC960_V2_ReportEvent() argument
4532 Controller, Event->EventCode); in DAC960_V2_ReportEvent()
4538 DAC960_Critical("Physical Device %d:%d %s\n", Controller, in DAC960_V2_ReportEvent()
4542 DAC960_Critical("Logical Drive %d (/dev/rd/c%dd%d) %s\n", Controller, in DAC960_V2_ReportEvent()
4543 Event->LogicalUnit, Controller->ControllerNumber, in DAC960_V2_ReportEvent()
4547 DAC960_Progress("Logical Drive %d (/dev/rd/c%dd%d) %s\n", Controller, in DAC960_V2_ReportEvent()
4548 Event->LogicalUnit, Controller->ControllerNumber, in DAC960_V2_ReportEvent()
4558 DAC960_Critical("Physical Device %d:%d %s\n", Controller, in DAC960_V2_ReportEvent()
4562 Controller, in DAC960_V2_ReportEvent()
4571 Controller, in DAC960_V2_ReportEvent()
4584 if (Controller->SuppressEnclosureMessages) break; in DAC960_V2_ReportEvent()
4586 DAC960_Critical("Enclosure %d %s\n", Controller, in DAC960_V2_ReportEvent()
4590 DAC960_Critical("Controller %s\n", Controller, EventMessage); in DAC960_V2_ReportEvent()
4594 Controller, Event->EventCode); in DAC960_V2_ReportEvent()
4605 static void DAC960_V2_ReportProgress(DAC960_Controller_T *Controller, in DAC960_V2_ReportProgress() argument
4611 Controller->EphemeralProgressMessage = true; in DAC960_V2_ReportProgress()
4613 "%d%% completed\n", Controller, in DAC960_V2_ReportProgress()
4616 Controller->ControllerNumber, in DAC960_V2_ReportProgress()
4619 Controller->EphemeralProgressMessage = false; in DAC960_V2_ReportProgress()
4630 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V2_ProcessCompletedCommand() local
4704 if (Controller->ShutdownMonitoringTimer) in DAC960_V2_ProcessCompletedCommand()
4709 Controller->V2.NewControllerInformation; in DAC960_V2_ProcessCompletedCommand()
4711 &Controller->V2.ControllerInformation; in DAC960_V2_ProcessCompletedCommand()
4712 Controller->LogicalDriveCount = in DAC960_V2_ProcessCompletedCommand()
4714 Controller->V2.NeedLogicalDeviceInformation = true; in DAC960_V2_ProcessCompletedCommand()
4715 Controller->V2.NeedPhysicalDeviceInformation = true; in DAC960_V2_ProcessCompletedCommand()
4716 Controller->V2.StartLogicalDeviceInformationScan = true; in DAC960_V2_ProcessCompletedCommand()
4717 Controller->V2.StartPhysicalDeviceInformationScan = true; in DAC960_V2_ProcessCompletedCommand()
4718 Controller->MonitoringAlertMode = in DAC960_V2_ProcessCompletedCommand()
4729 DAC960_V2_ReportEvent(Controller, Controller->V2.Event); in DAC960_V2_ProcessCompletedCommand()
4731 Controller->V2.NextEventSequenceNumber++; in DAC960_V2_ProcessCompletedCommand()
4737 Controller->V2.NewPhysicalDeviceInformation; in DAC960_V2_ProcessCompletedCommand()
4738 unsigned int PhysicalDeviceIndex = Controller->V2.PhysicalDeviceIndex; in DAC960_V2_ProcessCompletedCommand()
4740 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4742 Controller->V2.InquiryUnitSerialNumber[PhysicalDeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4757 Controller, in DAC960_V2_ProcessCompletedCommand()
4760 Controller->V2.PhysicalDeviceInformation in DAC960_V2_ProcessCompletedCommand()
4762 Controller->V2.InquiryUnitSerialNumber in DAC960_V2_ProcessCompletedCommand()
4770 Controller->V2.PhysicalDeviceInformation[DeviceIndex] = in DAC960_V2_ProcessCompletedCommand()
4771 Controller->V2.PhysicalDeviceInformation[DeviceIndex+1]; in DAC960_V2_ProcessCompletedCommand()
4772 Controller->V2.InquiryUnitSerialNumber[DeviceIndex] = in DAC960_V2_ProcessCompletedCommand()
4773 Controller->V2.InquiryUnitSerialNumber[DeviceIndex+1]; in DAC960_V2_ProcessCompletedCommand()
4775 Controller->V2.PhysicalDeviceInformation in DAC960_V2_ProcessCompletedCommand()
4777 Controller->V2.InquiryUnitSerialNumber in DAC960_V2_ProcessCompletedCommand()
4780 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4782 Controller->V2.InquiryUnitSerialNumber[PhysicalDeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4806 Controller, in DAC960_V2_ProcessCompletedCommand()
4824 Controller->V2.PhysicalDeviceInformation[DeviceIndex] = in DAC960_V2_ProcessCompletedCommand()
4825 Controller->V2.PhysicalDeviceInformation[DeviceIndex-1]; in DAC960_V2_ProcessCompletedCommand()
4826 Controller->V2.InquiryUnitSerialNumber[DeviceIndex] = in DAC960_V2_ProcessCompletedCommand()
4827 Controller->V2.InquiryUnitSerialNumber[DeviceIndex-1]; in DAC960_V2_ProcessCompletedCommand()
4829 Controller->V2.PhysicalDeviceInformation in DAC960_V2_ProcessCompletedCommand()
4832 Controller->V2.InquiryUnitSerialNumber in DAC960_V2_ProcessCompletedCommand()
4835 Controller->V2.NeedDeviceSerialNumberInformation = true; in DAC960_V2_ProcessCompletedCommand()
4843 "Physical Device %d:%d is now %s\n", Controller, in DAC960_V2_ProcessCompletedCommand()
4890 Controller, in DAC960_V2_ProcessCompletedCommand()
4900 Controller, in DAC960_V2_ProcessCompletedCommand()
4915 Controller->V2.NeedDeviceSerialNumberInformation = true; in DAC960_V2_ProcessCompletedCommand()
4920 Controller->V2.PhysicalDeviceIndex++; in DAC960_V2_ProcessCompletedCommand()
4925 for (DeviceIndex = Controller->V2.PhysicalDeviceIndex; in DAC960_V2_ProcessCompletedCommand()
4930 Controller->V2.PhysicalDeviceInformation[DeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4932 Controller->V2.InquiryUnitSerialNumber[DeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4935 Controller, in DAC960_V2_ProcessCompletedCommand()
4938 Controller->V2.PhysicalDeviceInformation[DeviceIndex] = NULL; in DAC960_V2_ProcessCompletedCommand()
4939 Controller->V2.InquiryUnitSerialNumber[DeviceIndex] = NULL; in DAC960_V2_ProcessCompletedCommand()
4943 Controller->V2.NeedPhysicalDeviceInformation = false; in DAC960_V2_ProcessCompletedCommand()
4949 Controller->V2.NewLogicalDeviceInformation; in DAC960_V2_ProcessCompletedCommand()
4953 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber]; in DAC960_V2_ProcessCompletedCommand()
4957 PhysicalDevice.Controller = 0; in DAC960_V2_ProcessCompletedCommand()
4961 Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] = in DAC960_V2_ProcessCompletedCommand()
4965 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] = in DAC960_V2_ProcessCompletedCommand()
4968 "Now Exists%s\n", Controller, in DAC960_V2_ProcessCompletedCommand()
4970 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
4978 DAC960_ComputeGenericDiskInfo(Controller); in DAC960_V2_ProcessCompletedCommand()
4988 "is now %s\n", Controller, in DAC960_V2_ProcessCompletedCommand()
4990 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
5006 Controller, LogicalDeviceNumber, in DAC960_V2_ProcessCompletedCommand()
5007 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
5013 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5020 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5027 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5034 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5041 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5048 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5058 Controller, in DAC960_V2_ProcessCompletedCommand()
5060 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
5068 Controller->V2.LogicalDriveFoundDuringScan in DAC960_V2_ProcessCompletedCommand()
5080 Controller->V2.LogicalDeviceInformation[LogicalDriveNumber]; in DAC960_V2_ProcessCompletedCommand()
5082 Controller->V2.LogicalDriveFoundDuringScan in DAC960_V2_ProcessCompletedCommand()
5086 "No Longer Exists\n", Controller, in DAC960_V2_ProcessCompletedCommand()
5088 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
5090 Controller->V2.LogicalDeviceInformation in DAC960_V2_ProcessCompletedCommand()
5093 Controller->LogicalDriveInitiallyAccessible in DAC960_V2_ProcessCompletedCommand()
5095 DAC960_ComputeGenericDiskInfo(Controller); in DAC960_V2_ProcessCompletedCommand()
5097 Controller->V2.NeedLogicalDeviceInformation = false; in DAC960_V2_ProcessCompletedCommand()
5102 Controller->V2.InquiryUnitSerialNumber[Controller->V2.PhysicalDeviceIndex - 1]; in DAC960_V2_ProcessCompletedCommand()
5110 Controller->V2.NewInquiryUnitSerialNumber, in DAC960_V2_ProcessCompletedCommand()
5113 Controller->V2.NeedDeviceSerialNumberInformation = false; in DAC960_V2_ProcessCompletedCommand()
5116 if (Controller->V2.HealthStatusBuffer->NextEventSequenceNumber in DAC960_V2_ProcessCompletedCommand()
5117 - Controller->V2.NextEventSequenceNumber > 0) in DAC960_V2_ProcessCompletedCommand()
5122 Controller->V2.NextEventSequenceNumber >> 16; in DAC960_V2_ProcessCompletedCommand()
5127 Controller->V2.NextEventSequenceNumber & 0xFFFF; in DAC960_V2_ProcessCompletedCommand()
5131 Controller->V2.EventDMA; in DAC960_V2_ProcessCompletedCommand()
5139 if (Controller->V2.NeedPhysicalDeviceInformation) in DAC960_V2_ProcessCompletedCommand()
5141 if (Controller->V2.NeedDeviceSerialNumberInformation) in DAC960_V2_ProcessCompletedCommand()
5144 Controller->V2.NewInquiryUnitSerialNumber; in DAC960_V2_ProcessCompletedCommand()
5147 DAC960_V2_ConstructNewUnitSerialNumber(Controller, CommandMailbox, in DAC960_V2_ProcessCompletedCommand()
5148 Controller->V2.NewPhysicalDeviceInformation->Channel, in DAC960_V2_ProcessCompletedCommand()
5149 Controller->V2.NewPhysicalDeviceInformation->TargetID, in DAC960_V2_ProcessCompletedCommand()
5150 Controller->V2.NewPhysicalDeviceInformation->LogicalUnit - 1); in DAC960_V2_ProcessCompletedCommand()
5156 if (Controller->V2.StartPhysicalDeviceInformationScan) in DAC960_V2_ProcessCompletedCommand()
5158 Controller->V2.PhysicalDeviceIndex = 0; in DAC960_V2_ProcessCompletedCommand()
5159 Controller->V2.NewPhysicalDeviceInformation->Channel = 0; in DAC960_V2_ProcessCompletedCommand()
5160 Controller->V2.NewPhysicalDeviceInformation->TargetID = 0; in DAC960_V2_ProcessCompletedCommand()
5161 Controller->V2.NewPhysicalDeviceInformation->LogicalUnit = 0; in DAC960_V2_ProcessCompletedCommand()
5162 Controller->V2.StartPhysicalDeviceInformationScan = false; in DAC960_V2_ProcessCompletedCommand()
5168 Controller->V2.NewPhysicalDeviceInformation->LogicalUnit; in DAC960_V2_ProcessCompletedCommand()
5170 Controller->V2.NewPhysicalDeviceInformation->TargetID; in DAC960_V2_ProcessCompletedCommand()
5172 Controller->V2.NewPhysicalDeviceInformation->Channel; in DAC960_V2_ProcessCompletedCommand()
5178 Controller->V2.NewPhysicalDeviceInformationDMA; in DAC960_V2_ProcessCompletedCommand()
5186 if (Controller->V2.NeedLogicalDeviceInformation) in DAC960_V2_ProcessCompletedCommand()
5188 if (Controller->V2.StartLogicalDeviceInformationScan) in DAC960_V2_ProcessCompletedCommand()
5194 Controller->V2.LogicalDriveFoundDuringScan in DAC960_V2_ProcessCompletedCommand()
5196 Controller->V2.NewLogicalDeviceInformation->LogicalDeviceNumber = 0; in DAC960_V2_ProcessCompletedCommand()
5197 Controller->V2.StartLogicalDeviceInformationScan = false; in DAC960_V2_ProcessCompletedCommand()
5203 Controller->V2.NewLogicalDeviceInformation->LogicalDeviceNumber; in DAC960_V2_ProcessCompletedCommand()
5209 Controller->V2.NewLogicalDeviceInformationDMA; in DAC960_V2_ProcessCompletedCommand()
5217 Controller->MonitoringTimerCount++; in DAC960_V2_ProcessCompletedCommand()
5218 Controller->MonitoringTimer.expires = in DAC960_V2_ProcessCompletedCommand()
5220 add_timer(&Controller->MonitoringTimer); in DAC960_V2_ProcessCompletedCommand()
5244 if (Controller->MonitoringCommandDeferred) in DAC960_V2_ProcessCompletedCommand()
5246 Controller->MonitoringCommandDeferred = false; in DAC960_V2_ProcessCompletedCommand()
5257 wake_up(&Controller->CommandWaitQueue); in DAC960_V2_ProcessCompletedCommand()
5268 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_GEM_InterruptHandler() local
5269 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_GEM_InterruptHandler()
5273 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_GEM_InterruptHandler()
5275 NextStatusMailbox = Controller->V2.NextStatusMailbox; in DAC960_GEM_InterruptHandler()
5280 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_GEM_InterruptHandler()
5287 if (++NextStatusMailbox > Controller->V2.LastStatusMailbox) in DAC960_GEM_InterruptHandler()
5288 NextStatusMailbox = Controller->V2.FirstStatusMailbox; in DAC960_GEM_InterruptHandler()
5291 Controller->V2.NextStatusMailbox = NextStatusMailbox; in DAC960_GEM_InterruptHandler()
5296 DAC960_ProcessRequest(Controller); in DAC960_GEM_InterruptHandler()
5297 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_GEM_InterruptHandler()
5309 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_BA_InterruptHandler() local
5310 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_BA_InterruptHandler()
5314 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_BA_InterruptHandler()
5316 NextStatusMailbox = Controller->V2.NextStatusMailbox; in DAC960_BA_InterruptHandler()
5321 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_BA_InterruptHandler()
5328 if (++NextStatusMailbox > Controller->V2.LastStatusMailbox) in DAC960_BA_InterruptHandler()
5329 NextStatusMailbox = Controller->V2.FirstStatusMailbox; in DAC960_BA_InterruptHandler()
5332 Controller->V2.NextStatusMailbox = NextStatusMailbox; in DAC960_BA_InterruptHandler()
5337 DAC960_ProcessRequest(Controller); in DAC960_BA_InterruptHandler()
5338 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_BA_InterruptHandler()
5351 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_LP_InterruptHandler() local
5352 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LP_InterruptHandler()
5356 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_LP_InterruptHandler()
5358 NextStatusMailbox = Controller->V2.NextStatusMailbox; in DAC960_LP_InterruptHandler()
5363 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_LP_InterruptHandler()
5370 if (++NextStatusMailbox > Controller->V2.LastStatusMailbox) in DAC960_LP_InterruptHandler()
5371 NextStatusMailbox = Controller->V2.FirstStatusMailbox; in DAC960_LP_InterruptHandler()
5374 Controller->V2.NextStatusMailbox = NextStatusMailbox; in DAC960_LP_InterruptHandler()
5379 DAC960_ProcessRequest(Controller); in DAC960_LP_InterruptHandler()
5380 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_LP_InterruptHandler()
5393 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_LA_InterruptHandler() local
5394 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LA_InterruptHandler()
5398 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_LA_InterruptHandler()
5400 NextStatusMailbox = Controller->V1.NextStatusMailbox; in DAC960_LA_InterruptHandler()
5405 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_LA_InterruptHandler()
5408 if (++NextStatusMailbox > Controller->V1.LastStatusMailbox) in DAC960_LA_InterruptHandler()
5409 NextStatusMailbox = Controller->V1.FirstStatusMailbox; in DAC960_LA_InterruptHandler()
5412 Controller->V1.NextStatusMailbox = NextStatusMailbox; in DAC960_LA_InterruptHandler()
5417 DAC960_ProcessRequest(Controller); in DAC960_LA_InterruptHandler()
5418 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_LA_InterruptHandler()
5431 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_PG_InterruptHandler() local
5432 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PG_InterruptHandler()
5436 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_PG_InterruptHandler()
5438 NextStatusMailbox = Controller->V1.NextStatusMailbox; in DAC960_PG_InterruptHandler()
5443 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_PG_InterruptHandler()
5446 if (++NextStatusMailbox > Controller->V1.LastStatusMailbox) in DAC960_PG_InterruptHandler()
5447 NextStatusMailbox = Controller->V1.FirstStatusMailbox; in DAC960_PG_InterruptHandler()
5450 Controller->V1.NextStatusMailbox = NextStatusMailbox; in DAC960_PG_InterruptHandler()
5455 DAC960_ProcessRequest(Controller); in DAC960_PG_InterruptHandler()
5456 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_PG_InterruptHandler()
5469 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_PD_InterruptHandler() local
5470 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PD_InterruptHandler()
5473 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_PD_InterruptHandler()
5478 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_PD_InterruptHandler()
5489 DAC960_ProcessRequest(Controller); in DAC960_PD_InterruptHandler()
5490 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_PD_InterruptHandler()
5507 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_P_InterruptHandler() local
5508 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_P_InterruptHandler()
5511 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_P_InterruptHandler()
5516 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_P_InterruptHandler()
5528 DAC960_P_To_PD_TranslateEnquiry(Controller->V1.NewEnquiry); in DAC960_P_InterruptHandler()
5533 DAC960_P_To_PD_TranslateDeviceState(Controller->V1.NewDeviceState); in DAC960_P_InterruptHandler()
5562 DAC960_ProcessRequest(Controller); in DAC960_P_InterruptHandler()
5563 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_P_InterruptHandler()
5575 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V1_QueueMonitoringCommand() local
5580 CommandMailbox->Type3.BusAddress = Controller->V1.NewEnquiryDMA; in DAC960_V1_QueueMonitoringCommand()
5592 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V2_QueueMonitoringCommand() local
5608 Controller->V2.NewControllerInformationDMA; in DAC960_V2_QueueMonitoringCommand()
5624 DAC960_Controller_T *Controller = from_timer(Controller, t, MonitoringTimer); in DAC960_MonitoringTimerFunction() local
5628 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_MonitoringTimerFunction()
5630 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_MonitoringTimerFunction()
5634 Command = DAC960_AllocateCommand(Controller); in DAC960_MonitoringTimerFunction()
5637 else Controller->MonitoringCommandDeferred = true; in DAC960_MonitoringTimerFunction()
5638 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_MonitoringTimerFunction()
5643 &Controller->V2.ControllerInformation; in DAC960_MonitoringTimerFunction()
5645 Controller->V2.HealthStatusBuffer->StatusChangeCounter; in DAC960_MonitoringTimerFunction()
5647 if (time_after(jiffies, Controller->SecondaryMonitoringTime in DAC960_MonitoringTimerFunction()
5656 Controller->V2.LogicalDeviceInformation[LogicalDriveNumber]; in DAC960_MonitoringTimerFunction()
5665 Controller->SecondaryMonitoringTime = jiffies; in DAC960_MonitoringTimerFunction()
5667 if (StatusChangeCounter == Controller->V2.StatusChangeCounter && in DAC960_MonitoringTimerFunction()
5668 Controller->V2.HealthStatusBuffer->NextEventSequenceNumber in DAC960_MonitoringTimerFunction()
5669 == Controller->V2.NextEventSequenceNumber && in DAC960_MonitoringTimerFunction()
5676 time_before(jiffies, Controller->PrimaryMonitoringTime in DAC960_MonitoringTimerFunction()
5680 Controller->MonitoringTimer.expires = in DAC960_MonitoringTimerFunction()
5682 add_timer(&Controller->MonitoringTimer); in DAC960_MonitoringTimerFunction()
5685 Controller->V2.StatusChangeCounter = StatusChangeCounter; in DAC960_MonitoringTimerFunction()
5686 Controller->PrimaryMonitoringTime = jiffies; in DAC960_MonitoringTimerFunction()
5688 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_MonitoringTimerFunction()
5692 Command = DAC960_AllocateCommand(Controller); in DAC960_MonitoringTimerFunction()
5695 else Controller->MonitoringCommandDeferred = true; in DAC960_MonitoringTimerFunction()
5696 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_MonitoringTimerFunction()
5700 wake_up(&Controller->HealthStatusWaitQueue); in DAC960_MonitoringTimerFunction()
5710 static bool DAC960_CheckStatusBuffer(DAC960_Controller_T *Controller, in DAC960_CheckStatusBuffer() argument
5714 if (Controller->InitialStatusLength + 1 + in DAC960_CheckStatusBuffer()
5715 Controller->CurrentStatusLength + ByteCount + 1 <= in DAC960_CheckStatusBuffer()
5716 Controller->CombinedStatusBufferLength) in DAC960_CheckStatusBuffer()
5718 if (Controller->CombinedStatusBufferLength == 0) in DAC960_CheckStatusBuffer()
5723 Controller->CombinedStatusBuffer = kmalloc(NewStatusBufferLength, in DAC960_CheckStatusBuffer()
5725 if (Controller->CombinedStatusBuffer == NULL) return false; in DAC960_CheckStatusBuffer()
5726 Controller->CombinedStatusBufferLength = NewStatusBufferLength; in DAC960_CheckStatusBuffer()
5729 NewStatusBuffer = kmalloc_array(2, Controller->CombinedStatusBufferLength, in DAC960_CheckStatusBuffer()
5734 Controller); in DAC960_CheckStatusBuffer()
5737 memcpy(NewStatusBuffer, Controller->CombinedStatusBuffer, in DAC960_CheckStatusBuffer()
5738 Controller->CombinedStatusBufferLength); in DAC960_CheckStatusBuffer()
5739 kfree(Controller->CombinedStatusBuffer); in DAC960_CheckStatusBuffer()
5740 Controller->CombinedStatusBuffer = NewStatusBuffer; in DAC960_CheckStatusBuffer()
5741 Controller->CombinedStatusBufferLength *= 2; in DAC960_CheckStatusBuffer()
5742 Controller->CurrentStatusBuffer = in DAC960_CheckStatusBuffer()
5743 &NewStatusBuffer[Controller->InitialStatusLength + 1]; in DAC960_CheckStatusBuffer()
5754 DAC960_Controller_T *Controller, in DAC960_Message() argument
5761 va_start(Arguments, Controller); in DAC960_Message()
5764 if (Controller == NULL) in DAC960_Message()
5770 if (!Controller->ControllerInitialized) in DAC960_Message()
5772 if (DAC960_CheckStatusBuffer(Controller, Length)) in DAC960_Message()
5774 strcpy(&Controller->CombinedStatusBuffer in DAC960_Message()
5775 [Controller->InitialStatusLength], in DAC960_Message()
5777 Controller->InitialStatusLength += Length; in DAC960_Message()
5778 Controller->CurrentStatusBuffer = in DAC960_Message()
5779 &Controller->CombinedStatusBuffer in DAC960_Message()
5780 [Controller->InitialStatusLength + 1]; in DAC960_Message()
5796 Controller->ControllerNumber, Buffer); in DAC960_Message()
5801 else if (DAC960_CheckStatusBuffer(Controller, Length)) in DAC960_Message()
5803 strcpy(&Controller->CurrentStatusBuffer[ in DAC960_Message()
5804 Controller->CurrentStatusLength], Buffer); in DAC960_Message()
5805 Controller->CurrentStatusLength += Length; in DAC960_Message()
5810 strcpy(Controller->ProgressBuffer, Buffer); in DAC960_Message()
5811 Controller->ProgressBufferLength = Length; in DAC960_Message()
5812 if (Controller->EphemeralProgressMessage) in DAC960_Message()
5814 if (time_after_eq(jiffies, Controller->LastProgressReportTime in DAC960_Message()
5818 Controller->ControllerNumber, Buffer); in DAC960_Message()
5819 Controller->LastProgressReportTime = jiffies; in DAC960_Message()
5823 Controller->ControllerNumber, Buffer); in DAC960_Message()
5827 strcpy(&Controller->UserStatusBuffer[Controller->UserStatusLength], in DAC960_Message()
5829 Controller->UserStatusLength += Length; in DAC960_Message()
5832 Controller->ControllerNumber, Buffer); in DAC960_Message()
5838 Controller->ControllerNumber, Buffer); in DAC960_Message()
5851 static bool DAC960_ParsePhysicalDevice(DAC960_Controller_T *Controller, in DAC960_ParsePhysicalDevice() argument
5864 XChannel >= Controller->Channels) in DAC960_ParsePhysicalDevice()
5870 XTargetID >= Controller->Targets) in DAC960_ParsePhysicalDevice()
5884 static bool DAC960_ParseLogicalDrive(DAC960_Controller_T *Controller, in DAC960_ParseLogicalDrive() argument
5909 static void DAC960_V1_SetDeviceState(DAC960_Controller_T *Controller, in DAC960_V1_SetDeviceState() argument
5927 DAC960_UserCritical("%s of Physical Device %d:%d Succeeded\n", Controller, in DAC960_V1_SetDeviceState()
5932 "Unable to Start Device\n", Controller, in DAC960_V1_SetDeviceState()
5937 "No Device at Address\n", Controller, in DAC960_V1_SetDeviceState()
5943 Controller, DeviceStateString, Channel, TargetID); in DAC960_V1_SetDeviceState()
5947 "Channel Busy\n", Controller, in DAC960_V1_SetDeviceState()
5952 "Unexpected Status %04X\n", Controller, in DAC960_V1_SetDeviceState()
5965 static bool DAC960_V1_ExecuteUserCommand(DAC960_Controller_T *Controller, in DAC960_V1_ExecuteUserCommand() argument
5973 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V1_ExecuteUserCommand()
5974 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_V1_ExecuteUserCommand()
5975 DAC960_WaitForCommand(Controller); in DAC960_V1_ExecuteUserCommand()
5976 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V1_ExecuteUserCommand()
5977 Controller->UserStatusLength = 0; in DAC960_V1_ExecuteUserCommand()
5985 DAC960_UserCritical("Cache Flush Completed\n", Controller); in DAC960_V1_ExecuteUserCommand()
5988 DAC960_ParsePhysicalDevice(Controller, &UserCommand[4], in DAC960_V1_ExecuteUserCommand()
5992 &Controller->V1.DeviceState[Channel][TargetID]; in DAC960_V1_ExecuteUserCommand()
5996 DAC960_V1_SetDeviceState(Controller, Command, Channel, TargetID, in DAC960_V1_ExecuteUserCommand()
5999 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6002 DAC960_ParsePhysicalDevice(Controller, &UserCommand[11], in DAC960_V1_ExecuteUserCommand()
6006 &Controller->V1.DeviceState[Channel][TargetID]; in DAC960_V1_ExecuteUserCommand()
6010 DAC960_V1_SetDeviceState(Controller, Command, Channel, TargetID, in DAC960_V1_ExecuteUserCommand()
6013 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6017 DAC960_ParsePhysicalDevice(Controller, &UserCommand[12], in DAC960_V1_ExecuteUserCommand()
6021 &Controller->V1.DeviceState[Channel][TargetID]; in DAC960_V1_ExecuteUserCommand()
6025 DAC960_V1_SetDeviceState(Controller, Command, Channel, TargetID, in DAC960_V1_ExecuteUserCommand()
6029 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6032 DAC960_ParsePhysicalDevice(Controller, &UserCommand[7], in DAC960_V1_ExecuteUserCommand()
6043 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6049 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6054 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6059 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6064 "in Progress\n", Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6068 "Unexpected Status %04X\n", Controller, in DAC960_V1_ExecuteUserCommand()
6074 DAC960_ParseLogicalDrive(Controller, &UserCommand[17], in DAC960_V1_ExecuteUserCommand()
6086 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6087 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6094 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6095 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6102 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6103 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6110 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6111 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6118 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6119 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6134 OldRebuildRateConstant = pci_alloc_consistent( Controller->PCIDevice, in DAC960_V1_ExecuteUserCommand()
6140 Controller); in DAC960_V1_ExecuteUserCommand()
6151 Controller); in DAC960_V1_ExecuteUserCommand()
6157 Controller, Command->V1.CommandStatus); in DAC960_V1_ExecuteUserCommand()
6161 pci_free_consistent(Controller->PCIDevice, sizeof(char), in DAC960_V1_ExecuteUserCommand()
6165 Controller, UserCommand); in DAC960_V1_ExecuteUserCommand()
6167 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V1_ExecuteUserCommand()
6169 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V1_ExecuteUserCommand()
6187 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V2_TranslatePhysicalDevice() local
6207 Controller->V2.PhysicalToLogicalDeviceDMA; in DAC960_V2_TranslatePhysicalDevice()
6214 *LogicalDeviceNumber = Controller->V2.PhysicalToLogicalDevice->LogicalDeviceNumber; in DAC960_V2_TranslatePhysicalDevice()
6227 static bool DAC960_V2_ExecuteUserCommand(DAC960_Controller_T *Controller, in DAC960_V2_ExecuteUserCommand() argument
6236 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V2_ExecuteUserCommand()
6237 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_V2_ExecuteUserCommand()
6238 DAC960_WaitForCommand(Controller); in DAC960_V2_ExecuteUserCommand()
6239 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V2_ExecuteUserCommand()
6240 Controller->UserStatusLength = 0; in DAC960_V2_ExecuteUserCommand()
6253 DAC960_UserCritical("Cache Flush Completed\n", Controller); in DAC960_V2_ExecuteUserCommand()
6256 DAC960_ParsePhysicalDevice(Controller, &UserCommand[4], in DAC960_V2_ExecuteUserCommand()
6269 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6275 DAC960_ParsePhysicalDevice(Controller, &UserCommand[11], in DAC960_V2_ExecuteUserCommand()
6288 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6294 DAC960_ParsePhysicalDevice(Controller, &UserCommand[12], in DAC960_V2_ExecuteUserCommand()
6307 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6313 DAC960_ParsePhysicalDevice(Controller, &UserCommand[7], in DAC960_V2_ExecuteUserCommand()
6324 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6330 DAC960_ParsePhysicalDevice(Controller, &UserCommand[14], in DAC960_V2_ExecuteUserCommand()
6341 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6347 DAC960_ParseLogicalDrive(Controller, &UserCommand[17], in DAC960_V2_ExecuteUserCommand()
6359 Controller, LogicalDriveNumber, in DAC960_V2_ExecuteUserCommand()
6360 Controller->ControllerNumber, in DAC960_V2_ExecuteUserCommand()
6367 DAC960_ParseLogicalDrive(Controller, &UserCommand[24], in DAC960_V2_ExecuteUserCommand()
6377 Controller, LogicalDriveNumber, in DAC960_V2_ExecuteUserCommand()
6378 Controller->ControllerNumber, in DAC960_V2_ExecuteUserCommand()
6388 DAC960_UserCritical("Discovery %s\n", Controller, in DAC960_V2_ExecuteUserCommand()
6411 Controller->V2.NewControllerInformationDMA; in DAC960_V2_ExecuteUserCommand()
6418 if (!Controller->V2.NewControllerInformation->PhysicalScanActive) in DAC960_V2_ExecuteUserCommand()
6422 DAC960_UserCritical("Discovery Completed\n", Controller); in DAC960_V2_ExecuteUserCommand()
6426 Controller->SuppressEnclosureMessages = true; in DAC960_V2_ExecuteUserCommand()
6428 Controller, UserCommand); in DAC960_V2_ExecuteUserCommand()
6430 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V2_ExecuteUserCommand()
6432 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V2_ExecuteUserCommand()
6444 DAC960_Controller_T *Controller = DAC960_Controllers[ControllerNumber]; in dac960_proc_show() local
6445 if (Controller == NULL) continue; in dac960_proc_show()
6446 if (Controller->MonitoringAlertMode) in dac960_proc_show()
6459 DAC960_Controller_T *Controller = (DAC960_Controller_T *)m->private; in dac960_initial_status_proc_show() local
6460 seq_printf(m, "%.*s", Controller->InitialStatusLength, Controller->CombinedStatusBuffer); in dac960_initial_status_proc_show()
6467 DAC960_Controller_T *Controller = (DAC960_Controller_T *) m->private; in dac960_current_status_proc_show() local
6471 if (jiffies != Controller->LastCurrentStatusTime) in dac960_current_status_proc_show()
6473 Controller->CurrentStatusLength = 0; in dac960_current_status_proc_show()
6474 DAC960_AnnounceDriver(Controller); in dac960_current_status_proc_show()
6475 DAC960_ReportControllerConfiguration(Controller); in dac960_current_status_proc_show()
6476 DAC960_ReportDeviceConfiguration(Controller); in dac960_current_status_proc_show()
6477 if (Controller->ProgressBufferLength > 0) in dac960_current_status_proc_show()
6478 ProgressMessageLength = Controller->ProgressBufferLength; in dac960_current_status_proc_show()
6479 if (DAC960_CheckStatusBuffer(Controller, 2 + ProgressMessageLength)) in dac960_current_status_proc_show()
6481 unsigned char *CurrentStatusBuffer = Controller->CurrentStatusBuffer; in dac960_current_status_proc_show()
6482 CurrentStatusBuffer[Controller->CurrentStatusLength++] = ' '; in dac960_current_status_proc_show()
6483 CurrentStatusBuffer[Controller->CurrentStatusLength++] = ' '; in dac960_current_status_proc_show()
6484 if (Controller->ProgressBufferLength > 0) in dac960_current_status_proc_show()
6485 strcpy(&CurrentStatusBuffer[Controller->CurrentStatusLength], in dac960_current_status_proc_show()
6486 Controller->ProgressBuffer); in dac960_current_status_proc_show()
6488 strcpy(&CurrentStatusBuffer[Controller->CurrentStatusLength], in dac960_current_status_proc_show()
6490 Controller->CurrentStatusLength += ProgressMessageLength; in dac960_current_status_proc_show()
6492 Controller->LastCurrentStatusTime = jiffies; in dac960_current_status_proc_show()
6494 seq_printf(m, "%.*s", Controller->CurrentStatusLength, Controller->CurrentStatusBuffer); in dac960_current_status_proc_show()
6500 DAC960_Controller_T *Controller = (DAC960_Controller_T *)m->private; in dac960_user_command_proc_show() local
6502 seq_printf(m, "%.*s", Controller->UserStatusLength, Controller->UserStatusBuffer); in dac960_user_command_proc_show()
6515 DAC960_Controller_T *Controller = PDE_DATA(file_inode(file)); in dac960_user_command_proc_write() local
6524 if (Controller->FirmwareType == DAC960_V1_Controller) in dac960_user_command_proc_write()
6525 return (DAC960_V1_ExecuteUserCommand(Controller, CommandBuffer) in dac960_user_command_proc_write()
6528 return (DAC960_V2_ExecuteUserCommand(Controller, CommandBuffer) in dac960_user_command_proc_write()
6546 static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller) in DAC960_CreateProcEntries() argument
6556 snprintf(Controller->ControllerName, sizeof(Controller->ControllerName), in DAC960_CreateProcEntries()
6557 "c%d", Controller->ControllerNumber); in DAC960_CreateProcEntries()
6558 ControllerProcEntry = proc_mkdir(Controller->ControllerName, in DAC960_CreateProcEntries()
6561 dac960_initial_status_proc_show, Controller); in DAC960_CreateProcEntries()
6563 dac960_current_status_proc_show, Controller); in DAC960_CreateProcEntries()
6564 …create_data("user_command", 0600, ControllerProcEntry, &dac960_user_command_proc_fops, Controller); in DAC960_CreateProcEntries()
6565 Controller->ControllerProcEntry = ControllerProcEntry; in DAC960_CreateProcEntries()
6574 static void DAC960_DestroyProcEntries(DAC960_Controller_T *Controller) in DAC960_DestroyProcEntries() argument
6576 if (Controller->ControllerProcEntry == NULL) in DAC960_DestroyProcEntries()
6578 remove_proc_entry("initial_status", Controller->ControllerProcEntry); in DAC960_DestroyProcEntries()
6579 remove_proc_entry("current_status", Controller->ControllerProcEntry); in DAC960_DestroyProcEntries()
6580 remove_proc_entry("user_command", Controller->ControllerProcEntry); in DAC960_DestroyProcEntries()
6581 remove_proc_entry(Controller->ControllerName, DAC960_ProcDirectoryEntry); in DAC960_DestroyProcEntries()
6582 Controller->ControllerProcEntry = NULL; in DAC960_DestroyProcEntries()
6590 DAC960_Controller_T *Controller; in DAC960_gam_get_controller_info() local
6605 Controller = DAC960_Controllers[ControllerNumber]; in DAC960_gam_get_controller_info()
6606 if (Controller == NULL) in DAC960_gam_get_controller_info()
6610 ControllerInfo.FirmwareType = Controller->FirmwareType; in DAC960_gam_get_controller_info()
6611 ControllerInfo.Channels = Controller->Channels; in DAC960_gam_get_controller_info()
6612 ControllerInfo.Targets = Controller->Targets; in DAC960_gam_get_controller_info()
6613 ControllerInfo.PCI_Bus = Controller->Bus; in DAC960_gam_get_controller_info()
6614 ControllerInfo.PCI_Device = Controller->Device; in DAC960_gam_get_controller_info()
6615 ControllerInfo.PCI_Function = Controller->Function; in DAC960_gam_get_controller_info()
6616 ControllerInfo.IRQ_Channel = Controller->IRQ_Channel; in DAC960_gam_get_controller_info()
6617 ControllerInfo.PCI_Address = Controller->PCI_Address; in DAC960_gam_get_controller_info()
6618 strcpy(ControllerInfo.ModelName, Controller->ModelName); in DAC960_gam_get_controller_info()
6619 strcpy(ControllerInfo.FirmwareVersion, Controller->FirmwareVersion); in DAC960_gam_get_controller_info()
6629 DAC960_Controller_T *Controller; in DAC960_gam_v1_execute_command() local
6656 Controller = DAC960_Controllers[ControllerNumber]; in DAC960_gam_v1_execute_command()
6657 if (Controller == NULL) in DAC960_gam_v1_execute_command()
6660 if (Controller->FirmwareType != DAC960_V1_Controller) in DAC960_gam_v1_execute_command()
6688 DCDB_IOBUF = pci_alloc_consistent(Controller->PCIDevice, in DAC960_gam_v1_execute_command()
6698 DataTransferBuffer = pci_zalloc_consistent(Controller->PCIDevice, in DAC960_gam_v1_execute_command()
6706 DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, in DAC960_gam_v1_execute_command()
6719 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_v1_execute_command()
6720 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_gam_v1_execute_command()
6721 DAC960_WaitForCommand(Controller); in DAC960_gam_v1_execute_command()
6722 while (Controller->V1.DirectCommandActive[DCDB.Channel] in DAC960_gam_v1_execute_command()
6725 spin_unlock_irq(&Controller->queue_lock); in DAC960_gam_v1_execute_command()
6726 __wait_event(Controller->CommandWaitQueue, in DAC960_gam_v1_execute_command()
6727 !Controller->V1.DirectCommandActive in DAC960_gam_v1_execute_command()
6729 spin_lock_irq(&Controller->queue_lock); in DAC960_gam_v1_execute_command()
6731 Controller->V1.DirectCommandActive[DCDB.Channel] in DAC960_gam_v1_execute_command()
6733 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_v1_execute_command()
6744 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_v1_execute_command()
6745 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_gam_v1_execute_command()
6746 DAC960_WaitForCommand(Controller); in DAC960_gam_v1_execute_command()
6747 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_v1_execute_command()
6758 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_v1_execute_command()
6760 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_v1_execute_command()
6775 Controller->V1.DirectCommandActive[DCDB.Channel] in DAC960_gam_v1_execute_command()
6786 pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength), in DAC960_gam_v1_execute_command()
6789 pci_free_consistent(Controller->PCIDevice, sizeof(DAC960_V1_DCDB_T), in DAC960_gam_v1_execute_command()
6798 DAC960_Controller_T *Controller; in DAC960_gam_v2_execute_command() local
6823 Controller = DAC960_Controllers[ControllerNumber]; in DAC960_gam_v2_execute_command()
6824 if (Controller == NULL) in DAC960_gam_v2_execute_command()
6826 if (Controller->FirmwareType != DAC960_V2_Controller){ in DAC960_gam_v2_execute_command()
6834 DataTransferBuffer = pci_zalloc_consistent(Controller->PCIDevice, in DAC960_gam_v2_execute_command()
6842 DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, in DAC960_gam_v2_execute_command()
6856 RequestSenseBuffer = pci_zalloc_consistent(Controller->PCIDevice, in DAC960_gam_v2_execute_command()
6865 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_v2_execute_command()
6866 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_gam_v2_execute_command()
6867 DAC960_WaitForCommand(Controller); in DAC960_gam_v2_execute_command()
6868 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_v2_execute_command()
6916 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_v2_execute_command()
6918 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_v2_execute_command()
6950 pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength), in DAC960_gam_v2_execute_command()
6953 pci_free_consistent(Controller->PCIDevice, RequestSenseLength, in DAC960_gam_v2_execute_command()
6963 DAC960_Controller_T *Controller; in DAC960_gam_v2_get_health_status() local
6981 Controller = DAC960_Controllers[ControllerNumber]; in DAC960_gam_v2_get_health_status()
6982 if (Controller == NULL) in DAC960_gam_v2_get_health_status()
6984 if (Controller->FirmwareType != DAC960_V2_Controller) { in DAC960_gam_v2_get_health_status()
6994 ErrorCode = wait_event_interruptible_timeout(Controller->HealthStatusWaitQueue, in DAC960_gam_v2_get_health_status()
6995 !(Controller->V2.HealthStatusBuffer->StatusChangeCounter in DAC960_gam_v2_get_health_status()
6997 Controller->V2.HealthStatusBuffer->NextEventSequenceNumber in DAC960_gam_v2_get_health_status()
7005 Controller->V2.HealthStatusBuffer, in DAC960_gam_v2_get_health_status()
7213 DAC960_Controller_T *Controller = DAC960_Controllers[i]; in DAC960_cleanup_module() local
7214 if (Controller == NULL) in DAC960_cleanup_module()
7216 DAC960_FinalizeController(Controller); in DAC960_cleanup_module()