Lines Matching refs:Controller
177 static void DAC960_AnnounceDriver(DAC960_Controller_T *Controller) in DAC960_AnnounceDriver() argument
181 DAC960_DriverDate " *****\n", Controller); in DAC960_AnnounceDriver()
183 "<lnz@dandelion.com>\n", Controller); in DAC960_AnnounceDriver()
191 static bool DAC960_Failure(DAC960_Controller_T *Controller, in DAC960_Failure() argument
195 Controller); in DAC960_Failure()
196 if (Controller->IO_Address == 0) in DAC960_Failure()
198 "PCI Address 0x%X\n", Controller, in DAC960_Failure()
199 Controller->Bus, Controller->Device, in DAC960_Failure()
200 Controller->Function, Controller->PCI_Address); in DAC960_Failure()
202 "0x%X PCI Address 0x%X\n", Controller, in DAC960_Failure()
203 Controller->Bus, Controller->Device, in DAC960_Failure()
204 Controller->Function, Controller->IO_Address, in DAC960_Failure()
205 Controller->PCI_Address); in DAC960_Failure()
206 DAC960_Error("%s FAILED - DETACHING\n", Controller, ErrorMessage); in DAC960_Failure()
264 static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller) in DAC960_CreateAuxiliaryStructures() argument
276 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_CreateAuxiliaryStructures()
281 Controller->PCIDevice, in DAC960_CreateAuxiliaryStructures()
285 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
287 Controller->ScatterGatherPool = ScatterGatherPool; in DAC960_CreateAuxiliaryStructures()
294 Controller->PCIDevice, in DAC960_CreateAuxiliaryStructures()
298 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
301 Controller->PCIDevice, sizeof(DAC960_SCSI_RequestSense_T), in DAC960_CreateAuxiliaryStructures()
305 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
308 Controller->ScatterGatherPool = ScatterGatherPool; in DAC960_CreateAuxiliaryStructures()
309 Controller->V2.RequestSensePool = RequestSensePool; in DAC960_CreateAuxiliaryStructures()
311 Controller->CommandAllocationGroupSize = CommandAllocationGroupSize; in DAC960_CreateAuxiliaryStructures()
312 Controller->FreeCommands = NULL; in DAC960_CreateAuxiliaryStructures()
314 CommandIdentifier <= Controller->DriverQueueDepth; in DAC960_CreateAuxiliaryStructures()
321 Controller->DriverQueueDepth - CommandIdentifier + 1; in DAC960_CreateAuxiliaryStructures()
328 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
334 Command->Controller = Controller; in DAC960_CreateAuxiliaryStructures()
335 Command->Next = Controller->FreeCommands; in DAC960_CreateAuxiliaryStructures()
336 Controller->FreeCommands = Command; in DAC960_CreateAuxiliaryStructures()
337 Controller->Commands[CommandIdentifier-1] = Command; in DAC960_CreateAuxiliaryStructures()
341 return DAC960_Failure(Controller, "AUXILIARY STRUCTURE CREATION"); in DAC960_CreateAuxiliaryStructures()
349 return DAC960_Failure(Controller, in DAC960_CreateAuxiliaryStructures()
353 if (Controller->FirmwareType == DAC960_V1_Controller) { in DAC960_CreateAuxiliaryStructures()
379 static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller) in DAC960_DestroyAuxiliaryStructures() argument
382 struct pci_pool *ScatterGatherPool = Controller->ScatterGatherPool; in DAC960_DestroyAuxiliaryStructures()
391 if (Controller->FirmwareType == DAC960_V2_Controller) in DAC960_DestroyAuxiliaryStructures()
392 RequestSensePool = Controller->V2.RequestSensePool; in DAC960_DestroyAuxiliaryStructures()
394 Controller->FreeCommands = NULL; in DAC960_DestroyAuxiliaryStructures()
395 for (i = 0; i < Controller->DriverQueueDepth; i++) in DAC960_DestroyAuxiliaryStructures()
397 DAC960_Command_T *Command = Controller->Commands[i]; in DAC960_DestroyAuxiliaryStructures()
402 if (Controller->FirmwareType == DAC960_V1_Controller) { in DAC960_DestroyAuxiliaryStructures()
419 % Controller->CommandAllocationGroupSize) == 1) { in DAC960_DestroyAuxiliaryStructures()
429 Controller->Commands[i] = NULL; in DAC960_DestroyAuxiliaryStructures()
433 if (Controller->CombinedStatusBuffer != NULL) in DAC960_DestroyAuxiliaryStructures()
435 kfree(Controller->CombinedStatusBuffer); in DAC960_DestroyAuxiliaryStructures()
436 Controller->CombinedStatusBuffer = NULL; in DAC960_DestroyAuxiliaryStructures()
437 Controller->CurrentStatusBuffer = NULL; in DAC960_DestroyAuxiliaryStructures()
442 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_DestroyAuxiliaryStructures()
449 kfree(Controller->V2.LogicalDeviceInformation[i]); in DAC960_DestroyAuxiliaryStructures()
450 Controller->V2.LogicalDeviceInformation[i] = NULL; in DAC960_DestroyAuxiliaryStructures()
455 kfree(Controller->V2.PhysicalDeviceInformation[i]); in DAC960_DestroyAuxiliaryStructures()
456 Controller->V2.PhysicalDeviceInformation[i] = NULL; in DAC960_DestroyAuxiliaryStructures()
457 kfree(Controller->V2.InquiryUnitSerialNumber[i]); in DAC960_DestroyAuxiliaryStructures()
458 Controller->V2.InquiryUnitSerialNumber[i] = NULL; in DAC960_DestroyAuxiliaryStructures()
497 *Controller) in DAC960_AllocateCommand() argument
499 DAC960_Command_T *Command = Controller->FreeCommands; in DAC960_AllocateCommand()
501 Controller->FreeCommands = Command->Next; in DAC960_AllocateCommand()
514 DAC960_Controller_T *Controller = Command->Controller; in DAC960_DeallocateCommand() local
517 Command->Next = Controller->FreeCommands; in DAC960_DeallocateCommand()
518 Controller->FreeCommands = Command; in DAC960_DeallocateCommand()
526 static void DAC960_WaitForCommand(DAC960_Controller_T *Controller) in DAC960_WaitForCommand() argument
528 spin_unlock_irq(&Controller->queue_lock); in DAC960_WaitForCommand()
529 __wait_event(Controller->CommandWaitQueue, Controller->FreeCommands); in DAC960_WaitForCommand()
530 spin_lock_irq(&Controller->queue_lock); in DAC960_WaitForCommand()
539 DAC960_Controller_T *Controller = Command->Controller; in DAC960_GEM_QueueCommand() local
540 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_GEM_QueueCommand()
543 Controller->V2.NextCommandMailbox; in DAC960_GEM_QueueCommand()
548 if (Controller->V2.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_GEM_QueueCommand()
549 Controller->V2.PreviousCommandMailbox2->Words[0] == 0) in DAC960_GEM_QueueCommand()
552 Controller->V2.PreviousCommandMailbox2 = in DAC960_GEM_QueueCommand()
553 Controller->V2.PreviousCommandMailbox1; in DAC960_GEM_QueueCommand()
554 Controller->V2.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_GEM_QueueCommand()
556 if (++NextCommandMailbox > Controller->V2.LastCommandMailbox) in DAC960_GEM_QueueCommand()
557 NextCommandMailbox = Controller->V2.FirstCommandMailbox; in DAC960_GEM_QueueCommand()
559 Controller->V2.NextCommandMailbox = NextCommandMailbox; in DAC960_GEM_QueueCommand()
568 DAC960_Controller_T *Controller = Command->Controller; in DAC960_BA_QueueCommand() local
569 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_BA_QueueCommand()
572 Controller->V2.NextCommandMailbox; in DAC960_BA_QueueCommand()
575 if (Controller->V2.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_BA_QueueCommand()
576 Controller->V2.PreviousCommandMailbox2->Words[0] == 0) in DAC960_BA_QueueCommand()
578 Controller->V2.PreviousCommandMailbox2 = in DAC960_BA_QueueCommand()
579 Controller->V2.PreviousCommandMailbox1; in DAC960_BA_QueueCommand()
580 Controller->V2.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_BA_QueueCommand()
581 if (++NextCommandMailbox > Controller->V2.LastCommandMailbox) in DAC960_BA_QueueCommand()
582 NextCommandMailbox = Controller->V2.FirstCommandMailbox; in DAC960_BA_QueueCommand()
583 Controller->V2.NextCommandMailbox = NextCommandMailbox; in DAC960_BA_QueueCommand()
593 DAC960_Controller_T *Controller = Command->Controller; in DAC960_LP_QueueCommand() local
594 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LP_QueueCommand()
597 Controller->V2.NextCommandMailbox; in DAC960_LP_QueueCommand()
600 if (Controller->V2.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_LP_QueueCommand()
601 Controller->V2.PreviousCommandMailbox2->Words[0] == 0) in DAC960_LP_QueueCommand()
603 Controller->V2.PreviousCommandMailbox2 = in DAC960_LP_QueueCommand()
604 Controller->V2.PreviousCommandMailbox1; in DAC960_LP_QueueCommand()
605 Controller->V2.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_LP_QueueCommand()
606 if (++NextCommandMailbox > Controller->V2.LastCommandMailbox) in DAC960_LP_QueueCommand()
607 NextCommandMailbox = Controller->V2.FirstCommandMailbox; in DAC960_LP_QueueCommand()
608 Controller->V2.NextCommandMailbox = NextCommandMailbox; in DAC960_LP_QueueCommand()
619 DAC960_Controller_T *Controller = Command->Controller; in DAC960_LA_QueueCommandDualMode() local
620 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LA_QueueCommandDualMode()
623 Controller->V1.NextCommandMailbox; in DAC960_LA_QueueCommandDualMode()
626 if (Controller->V1.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_LA_QueueCommandDualMode()
627 Controller->V1.PreviousCommandMailbox2->Words[0] == 0) in DAC960_LA_QueueCommandDualMode()
629 Controller->V1.PreviousCommandMailbox2 = in DAC960_LA_QueueCommandDualMode()
630 Controller->V1.PreviousCommandMailbox1; in DAC960_LA_QueueCommandDualMode()
631 Controller->V1.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_LA_QueueCommandDualMode()
632 if (++NextCommandMailbox > Controller->V1.LastCommandMailbox) in DAC960_LA_QueueCommandDualMode()
633 NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_LA_QueueCommandDualMode()
634 Controller->V1.NextCommandMailbox = NextCommandMailbox; in DAC960_LA_QueueCommandDualMode()
645 DAC960_Controller_T *Controller = Command->Controller; in DAC960_LA_QueueCommandSingleMode() local
646 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LA_QueueCommandSingleMode()
649 Controller->V1.NextCommandMailbox; in DAC960_LA_QueueCommandSingleMode()
652 if (Controller->V1.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_LA_QueueCommandSingleMode()
653 Controller->V1.PreviousCommandMailbox2->Words[0] == 0) in DAC960_LA_QueueCommandSingleMode()
655 Controller->V1.PreviousCommandMailbox2 = in DAC960_LA_QueueCommandSingleMode()
656 Controller->V1.PreviousCommandMailbox1; in DAC960_LA_QueueCommandSingleMode()
657 Controller->V1.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_LA_QueueCommandSingleMode()
658 if (++NextCommandMailbox > Controller->V1.LastCommandMailbox) in DAC960_LA_QueueCommandSingleMode()
659 NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_LA_QueueCommandSingleMode()
660 Controller->V1.NextCommandMailbox = NextCommandMailbox; in DAC960_LA_QueueCommandSingleMode()
671 DAC960_Controller_T *Controller = Command->Controller; in DAC960_PG_QueueCommandDualMode() local
672 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PG_QueueCommandDualMode()
675 Controller->V1.NextCommandMailbox; in DAC960_PG_QueueCommandDualMode()
678 if (Controller->V1.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_PG_QueueCommandDualMode()
679 Controller->V1.PreviousCommandMailbox2->Words[0] == 0) in DAC960_PG_QueueCommandDualMode()
681 Controller->V1.PreviousCommandMailbox2 = in DAC960_PG_QueueCommandDualMode()
682 Controller->V1.PreviousCommandMailbox1; in DAC960_PG_QueueCommandDualMode()
683 Controller->V1.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_PG_QueueCommandDualMode()
684 if (++NextCommandMailbox > Controller->V1.LastCommandMailbox) in DAC960_PG_QueueCommandDualMode()
685 NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_PG_QueueCommandDualMode()
686 Controller->V1.NextCommandMailbox = NextCommandMailbox; in DAC960_PG_QueueCommandDualMode()
697 DAC960_Controller_T *Controller = Command->Controller; in DAC960_PG_QueueCommandSingleMode() local
698 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PG_QueueCommandSingleMode()
701 Controller->V1.NextCommandMailbox; in DAC960_PG_QueueCommandSingleMode()
704 if (Controller->V1.PreviousCommandMailbox1->Words[0] == 0 || in DAC960_PG_QueueCommandSingleMode()
705 Controller->V1.PreviousCommandMailbox2->Words[0] == 0) in DAC960_PG_QueueCommandSingleMode()
707 Controller->V1.PreviousCommandMailbox2 = in DAC960_PG_QueueCommandSingleMode()
708 Controller->V1.PreviousCommandMailbox1; in DAC960_PG_QueueCommandSingleMode()
709 Controller->V1.PreviousCommandMailbox1 = NextCommandMailbox; in DAC960_PG_QueueCommandSingleMode()
710 if (++NextCommandMailbox > Controller->V1.LastCommandMailbox) in DAC960_PG_QueueCommandSingleMode()
711 NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_PG_QueueCommandSingleMode()
712 Controller->V1.NextCommandMailbox = NextCommandMailbox; in DAC960_PG_QueueCommandSingleMode()
722 DAC960_Controller_T *Controller = Command->Controller; in DAC960_PD_QueueCommand() local
723 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PD_QueueCommand()
739 DAC960_Controller_T *Controller = Command->Controller; in DAC960_P_QueueCommand() local
740 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_P_QueueCommand()
785 DAC960_Controller_T *Controller = Command->Controller; in DAC960_ExecuteCommand() local
790 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_ExecuteCommand()
792 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_ExecuteCommand()
806 static bool DAC960_V1_ExecuteType3(DAC960_Controller_T *Controller, in DAC960_V1_ExecuteType3() argument
810 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V1_ExecuteType3()
830 static bool DAC960_V1_ExecuteType3B(DAC960_Controller_T *Controller, in DAC960_V1_ExecuteType3B() argument
835 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V1_ExecuteType3B()
856 static bool DAC960_V1_ExecuteType3D(DAC960_Controller_T *Controller, in DAC960_V1_ExecuteType3D() argument
862 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V1_ExecuteType3D()
886 static bool DAC960_V2_GeneralInfo(DAC960_Controller_T *Controller) in DAC960_V2_GeneralInfo() argument
888 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_GeneralInfo()
903 Controller->V2.HealthStatusBufferDMA; in DAC960_V2_GeneralInfo()
924 static bool DAC960_V2_NewControllerInfo(DAC960_Controller_T *Controller) in DAC960_V2_NewControllerInfo() argument
926 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_NewControllerInfo()
942 Controller->V2.NewControllerInformationDMA; in DAC960_V2_NewControllerInfo()
962 static bool DAC960_V2_NewLogicalDeviceInfo(DAC960_Controller_T *Controller, in DAC960_V2_NewLogicalDeviceInfo() argument
965 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_NewLogicalDeviceInfo()
985 Controller->V2.NewLogicalDeviceInformationDMA; in DAC960_V2_NewLogicalDeviceInfo()
1013 static bool DAC960_V2_NewPhysicalDeviceInfo(DAC960_Controller_T *Controller, in DAC960_V2_NewPhysicalDeviceInfo() argument
1018 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_NewPhysicalDeviceInfo()
1039 Controller->V2.NewPhysicalDeviceInformationDMA; in DAC960_V2_NewPhysicalDeviceInfo()
1052 DAC960_Controller_T *Controller, in DAC960_V2_ConstructNewUnitSerialNumber() argument
1077 Controller->V2.NewInquiryUnitSerialNumberDMA; in DAC960_V2_ConstructNewUnitSerialNumber()
1098 static bool DAC960_V2_NewInquiryUnitSerialNumber(DAC960_Controller_T *Controller, in DAC960_V2_NewInquiryUnitSerialNumber() argument
1105 Command = DAC960_AllocateCommand(Controller); in DAC960_V2_NewInquiryUnitSerialNumber()
1110 DAC960_V2_ConstructNewUnitSerialNumber(Controller, CommandMailbox, in DAC960_V2_NewInquiryUnitSerialNumber()
1126 static bool DAC960_V2_DeviceOperation(DAC960_Controller_T *Controller, in DAC960_V2_DeviceOperation() argument
1131 DAC960_Command_T *Command = DAC960_AllocateCommand(Controller); in DAC960_V2_DeviceOperation()
1159 *Controller) in DAC960_V1_EnableMemoryMailboxInterface() argument
1161 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_V1_EnableMemoryMailboxInterface()
1162 DAC960_HardwareType_T hw_type = Controller->HardwareType; in DAC960_V1_EnableMemoryMailboxInterface()
1163 struct pci_dev *PCI_Device = Controller->PCIDevice; in DAC960_V1_EnableMemoryMailboxInterface()
1164 struct dma_loaf *DmaPages = &Controller->DmaPages; in DAC960_V1_EnableMemoryMailboxInterface()
1182 if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) in DAC960_V1_EnableMemoryMailboxInterface()
1183 return DAC960_Failure(Controller, "DMA mask out of range"); in DAC960_V1_EnableMemoryMailboxInterface()
1184 Controller->BounceBufferLimit = DMA_BIT_MASK(32); in DAC960_V1_EnableMemoryMailboxInterface()
1213 Controller->V1.FirstCommandMailbox = CommandMailboxesMemory; in DAC960_V1_EnableMemoryMailboxInterface()
1214 Controller->V1.FirstCommandMailboxDMA = CommandMailboxesMemoryDMA; in DAC960_V1_EnableMemoryMailboxInterface()
1217 Controller->V1.LastCommandMailbox = CommandMailboxesMemory; in DAC960_V1_EnableMemoryMailboxInterface()
1218 Controller->V1.NextCommandMailbox = Controller->V1.FirstCommandMailbox; in DAC960_V1_EnableMemoryMailboxInterface()
1219 Controller->V1.PreviousCommandMailbox1 = Controller->V1.LastCommandMailbox; in DAC960_V1_EnableMemoryMailboxInterface()
1220 Controller->V1.PreviousCommandMailbox2 = in DAC960_V1_EnableMemoryMailboxInterface()
1221 Controller->V1.LastCommandMailbox - 1; in DAC960_V1_EnableMemoryMailboxInterface()
1227 Controller->V1.FirstStatusMailbox = StatusMailboxesMemory; in DAC960_V1_EnableMemoryMailboxInterface()
1228 Controller->V1.FirstStatusMailboxDMA = StatusMailboxesMemoryDMA; in DAC960_V1_EnableMemoryMailboxInterface()
1230 Controller->V1.LastStatusMailbox = StatusMailboxesMemory; in DAC960_V1_EnableMemoryMailboxInterface()
1231 Controller->V1.NextStatusMailbox = Controller->V1.FirstStatusMailbox; in DAC960_V1_EnableMemoryMailboxInterface()
1234 Controller->V1.MonitoringDCDB = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1236 &Controller->V1.MonitoringDCDB_DMA); in DAC960_V1_EnableMemoryMailboxInterface()
1238 Controller->V1.NewEnquiry = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1240 &Controller->V1.NewEnquiryDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1242 Controller->V1.NewErrorTable = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1244 &Controller->V1.NewErrorTableDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1246 Controller->V1.EventLogEntry = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1248 &Controller->V1.EventLogEntryDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1250 Controller->V1.RebuildProgress = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1252 &Controller->V1.RebuildProgressDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1254 Controller->V1.NewLogicalDriveInformation = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1256 &Controller->V1.NewLogicalDriveInformationDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1258 Controller->V1.BackgroundInitializationStatus = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1260 &Controller->V1.BackgroundInitializationStatusDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1262 Controller->V1.NewDeviceState = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1264 &Controller->V1.NewDeviceStateDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1266 Controller->V1.NewInquiryStandardData = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1268 &Controller->V1.NewInquiryStandardDataDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1270 Controller->V1.NewInquiryUnitSerialNumber = slice_dma_loaf(DmaPages, in DAC960_V1_EnableMemoryMailboxInterface()
1272 &Controller->V1.NewInquiryUnitSerialNumberDMA); in DAC960_V1_EnableMemoryMailboxInterface()
1278 Controller->V1.DualModeMemoryMailboxInterface = true; in DAC960_V1_EnableMemoryMailboxInterface()
1283 Controller->V1.FirstCommandMailboxDMA; in DAC960_V1_EnableMemoryMailboxInterface()
1285 Controller->V1.FirstStatusMailboxDMA; in DAC960_V1_EnableMemoryMailboxInterface()
1289 switch (Controller->HardwareType) in DAC960_V1_EnableMemoryMailboxInterface()
1315 Controller->V1.DualModeMemoryMailboxInterface = false; in DAC960_V1_EnableMemoryMailboxInterface()
1343 Controller->V1.DualModeMemoryMailboxInterface = false; in DAC960_V1_EnableMemoryMailboxInterface()
1347 DAC960_Failure(Controller, "Unknown Controller Type\n"); in DAC960_V1_EnableMemoryMailboxInterface()
1366 *Controller) in DAC960_V2_EnableMemoryMailboxInterface() argument
1368 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_V2_EnableMemoryMailboxInterface()
1369 struct pci_dev *PCI_Device = Controller->PCIDevice; in DAC960_V2_EnableMemoryMailboxInterface()
1370 struct dma_loaf *DmaPages = &Controller->DmaPages; in DAC960_V2_EnableMemoryMailboxInterface()
1385 if (!pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(64))) in DAC960_V2_EnableMemoryMailboxInterface()
1386 Controller->BounceBufferLimit = DMA_BIT_MASK(64); in DAC960_V2_EnableMemoryMailboxInterface()
1387 else if (!pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) in DAC960_V2_EnableMemoryMailboxInterface()
1388 Controller->BounceBufferLimit = DMA_BIT_MASK(32); in DAC960_V2_EnableMemoryMailboxInterface()
1390 return DAC960_Failure(Controller, "DMA mask out of range"); in DAC960_V2_EnableMemoryMailboxInterface()
1420 Controller->V2.FirstCommandMailbox = CommandMailboxesMemory; in DAC960_V2_EnableMemoryMailboxInterface()
1421 Controller->V2.FirstCommandMailboxDMA = CommandMailboxesMemoryDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1424 Controller->V2.LastCommandMailbox = CommandMailboxesMemory; in DAC960_V2_EnableMemoryMailboxInterface()
1425 Controller->V2.NextCommandMailbox = Controller->V2.FirstCommandMailbox; in DAC960_V2_EnableMemoryMailboxInterface()
1426 Controller->V2.PreviousCommandMailbox1 = Controller->V2.LastCommandMailbox; in DAC960_V2_EnableMemoryMailboxInterface()
1427 Controller->V2.PreviousCommandMailbox2 = in DAC960_V2_EnableMemoryMailboxInterface()
1428 Controller->V2.LastCommandMailbox - 1; in DAC960_V2_EnableMemoryMailboxInterface()
1434 Controller->V2.FirstStatusMailbox = StatusMailboxesMemory; in DAC960_V2_EnableMemoryMailboxInterface()
1435 Controller->V2.FirstStatusMailboxDMA = StatusMailboxesMemoryDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1437 Controller->V2.LastStatusMailbox = StatusMailboxesMemory; in DAC960_V2_EnableMemoryMailboxInterface()
1438 Controller->V2.NextStatusMailbox = Controller->V2.FirstStatusMailbox; in DAC960_V2_EnableMemoryMailboxInterface()
1440 Controller->V2.HealthStatusBuffer = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1442 &Controller->V2.HealthStatusBufferDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1444 Controller->V2.NewControllerInformation = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1446 &Controller->V2.NewControllerInformationDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1448 Controller->V2.NewLogicalDeviceInformation = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1450 &Controller->V2.NewLogicalDeviceInformationDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1452 Controller->V2.NewPhysicalDeviceInformation = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1454 &Controller->V2.NewPhysicalDeviceInformationDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1456 Controller->V2.NewInquiryUnitSerialNumber = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1458 &Controller->V2.NewInquiryUnitSerialNumberDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1460 Controller->V2.Event = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1462 &Controller->V2.EventDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1464 Controller->V2.PhysicalToLogicalDevice = slice_dma_loaf(DmaPages, in DAC960_V2_EnableMemoryMailboxInterface()
1466 &Controller->V2.PhysicalToLogicalDeviceDMA); in DAC960_V2_EnableMemoryMailboxInterface()
1489 Controller->V2.HealthStatusBufferDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1491 Controller->V2.FirstCommandMailboxDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1493 Controller->V2.FirstStatusMailboxDMA; in DAC960_V2_EnableMemoryMailboxInterface()
1494 switch (Controller->HardwareType) in DAC960_V2_EnableMemoryMailboxInterface()
1530 DAC960_Failure(Controller, "Unknown Controller Type\n"); in DAC960_V2_EnableMemoryMailboxInterface()
1546 *Controller) in DAC960_V1_ReadControllerConfiguration() argument
1555 if (!init_dma_loaf(Controller->PCIDevice, &local_dma, in DAC960_V1_ReadControllerConfiguration()
1557 return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION"); in DAC960_V1_ReadControllerConfiguration()
1562 if (!DAC960_V1_ExecuteType3(Controller, DAC960_V1_Enquiry, in DAC960_V1_ReadControllerConfiguration()
1563 Controller->V1.NewEnquiryDMA)) { in DAC960_V1_ReadControllerConfiguration()
1564 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1565 return DAC960_Failure(Controller, "ENQUIRY"); in DAC960_V1_ReadControllerConfiguration()
1567 memcpy(&Controller->V1.Enquiry, Controller->V1.NewEnquiry, in DAC960_V1_ReadControllerConfiguration()
1570 if (!DAC960_V1_ExecuteType3(Controller, DAC960_V1_Enquiry2, Enquiry2DMA)) { in DAC960_V1_ReadControllerConfiguration()
1571 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1572 return DAC960_Failure(Controller, "ENQUIRY2"); in DAC960_V1_ReadControllerConfiguration()
1575 if (!DAC960_V1_ExecuteType3(Controller, DAC960_V1_ReadConfig2, Config2DMA)) { in DAC960_V1_ReadControllerConfiguration()
1576 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1577 return DAC960_Failure(Controller, "READ CONFIG2"); in DAC960_V1_ReadControllerConfiguration()
1580 if (!DAC960_V1_ExecuteType3(Controller, DAC960_V1_GetLogicalDriveInformation, in DAC960_V1_ReadControllerConfiguration()
1581 Controller->V1.NewLogicalDriveInformationDMA)) { in DAC960_V1_ReadControllerConfiguration()
1582 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1583 return DAC960_Failure(Controller, "GET LOGICAL DRIVE INFORMATION"); in DAC960_V1_ReadControllerConfiguration()
1585 memcpy(&Controller->V1.LogicalDriveInformation, in DAC960_V1_ReadControllerConfiguration()
1586 Controller->V1.NewLogicalDriveInformation, in DAC960_V1_ReadControllerConfiguration()
1591 if (!DAC960_V1_ExecuteType3D(Controller, DAC960_V1_GetDeviceState, in DAC960_V1_ReadControllerConfiguration()
1593 Controller->V1.NewDeviceStateDMA)) { in DAC960_V1_ReadControllerConfiguration()
1594 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1595 return DAC960_Failure(Controller, "GET DEVICE STATE"); in DAC960_V1_ReadControllerConfiguration()
1597 memcpy(&Controller->V1.DeviceState[Channel][TargetID], in DAC960_V1_ReadControllerConfiguration()
1598 Controller->V1.NewDeviceState, sizeof(DAC960_V1_DeviceState_T)); in DAC960_V1_ReadControllerConfiguration()
1607 strcpy(Controller->ModelName, "DAC960PU"); in DAC960_V1_ReadControllerConfiguration()
1608 else strcpy(Controller->ModelName, "DAC960PD"); in DAC960_V1_ReadControllerConfiguration()
1611 strcpy(Controller->ModelName, "DAC960PL"); in DAC960_V1_ReadControllerConfiguration()
1614 strcpy(Controller->ModelName, "DAC960PG"); in DAC960_V1_ReadControllerConfiguration()
1617 strcpy(Controller->ModelName, "DAC960PJ"); in DAC960_V1_ReadControllerConfiguration()
1620 strcpy(Controller->ModelName, "DAC960PR"); in DAC960_V1_ReadControllerConfiguration()
1623 strcpy(Controller->ModelName, "DAC960PT"); in DAC960_V1_ReadControllerConfiguration()
1626 strcpy(Controller->ModelName, "DAC960PTL0"); in DAC960_V1_ReadControllerConfiguration()
1629 strcpy(Controller->ModelName, "DAC960PRL"); in DAC960_V1_ReadControllerConfiguration()
1632 strcpy(Controller->ModelName, "DAC960PTL1"); in DAC960_V1_ReadControllerConfiguration()
1635 strcpy(Controller->ModelName, "DAC1164P"); in DAC960_V1_ReadControllerConfiguration()
1638 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1639 return DAC960_Failure(Controller, "MODEL VERIFICATION"); in DAC960_V1_ReadControllerConfiguration()
1641 strcpy(Controller->FullModelName, "Mylex "); in DAC960_V1_ReadControllerConfiguration()
1642 strcat(Controller->FullModelName, Controller->ModelName); in DAC960_V1_ReadControllerConfiguration()
1675 Controller->V1.Enquiry.MajorFirmwareVersion; in DAC960_V1_ReadControllerConfiguration()
1677 Controller->V1.Enquiry.MinorFirmwareVersion; in DAC960_V1_ReadControllerConfiguration()
1681 sprintf(Controller->FirmwareVersion, "%d.%02d-%c-%02d", in DAC960_V1_ReadControllerConfiguration()
1684 if (!((Controller->FirmwareVersion[0] == '5' && in DAC960_V1_ReadControllerConfiguration()
1685 strcmp(Controller->FirmwareVersion, "5.06") >= 0) || in DAC960_V1_ReadControllerConfiguration()
1686 (Controller->FirmwareVersion[0] == '4' && in DAC960_V1_ReadControllerConfiguration()
1687 strcmp(Controller->FirmwareVersion, "4.06") >= 0) || in DAC960_V1_ReadControllerConfiguration()
1688 (Controller->FirmwareVersion[0] == '3' && in DAC960_V1_ReadControllerConfiguration()
1689 strcmp(Controller->FirmwareVersion, "3.51") >= 0) || in DAC960_V1_ReadControllerConfiguration()
1690 (Controller->FirmwareVersion[0] == '2' && in DAC960_V1_ReadControllerConfiguration()
1691 strcmp(Controller->FirmwareVersion, FIRMWARE_27X) >= 0))) in DAC960_V1_ReadControllerConfiguration()
1693 DAC960_Failure(Controller, "FIRMWARE VERSION VERIFICATION"); in DAC960_V1_ReadControllerConfiguration()
1694 DAC960_Error("Firmware Version = '%s'\n", Controller, in DAC960_V1_ReadControllerConfiguration()
1695 Controller->FirmwareVersion); in DAC960_V1_ReadControllerConfiguration()
1696 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1703 Controller->Channels = Enquiry2->ActualChannels; in DAC960_V1_ReadControllerConfiguration()
1704 Controller->Targets = Enquiry2->MaxTargets; in DAC960_V1_ReadControllerConfiguration()
1705 Controller->MemorySize = Enquiry2->MemorySize >> 20; in DAC960_V1_ReadControllerConfiguration()
1706 Controller->V1.SAFTE_EnclosureManagementEnabled = in DAC960_V1_ReadControllerConfiguration()
1715 Controller->ControllerQueueDepth = Controller->V1.Enquiry.MaxCommands; in DAC960_V1_ReadControllerConfiguration()
1716 Controller->DriverQueueDepth = Controller->ControllerQueueDepth - 1; in DAC960_V1_ReadControllerConfiguration()
1717 if (Controller->DriverQueueDepth > DAC960_MaxDriverQueueDepth) in DAC960_V1_ReadControllerConfiguration()
1718 Controller->DriverQueueDepth = DAC960_MaxDriverQueueDepth; in DAC960_V1_ReadControllerConfiguration()
1719 Controller->LogicalDriveCount = in DAC960_V1_ReadControllerConfiguration()
1720 Controller->V1.Enquiry.NumberOfLogicalDrives; in DAC960_V1_ReadControllerConfiguration()
1721 Controller->MaxBlocksPerCommand = Enquiry2->MaxBlocksPerCommand; in DAC960_V1_ReadControllerConfiguration()
1722 Controller->ControllerScatterGatherLimit = Enquiry2->MaxScatterGatherEntries; in DAC960_V1_ReadControllerConfiguration()
1723 Controller->DriverScatterGatherLimit = in DAC960_V1_ReadControllerConfiguration()
1724 Controller->ControllerScatterGatherLimit; in DAC960_V1_ReadControllerConfiguration()
1725 if (Controller->DriverScatterGatherLimit > DAC960_V1_ScatterGatherLimit) in DAC960_V1_ReadControllerConfiguration()
1726 Controller->DriverScatterGatherLimit = DAC960_V1_ScatterGatherLimit; in DAC960_V1_ReadControllerConfiguration()
1730 Controller->V1.StripeSize = Config2->BlocksPerStripe * Config2->BlockFactor in DAC960_V1_ReadControllerConfiguration()
1732 Controller->V1.SegmentSize = Config2->BlocksPerCacheLine * Config2->BlockFactor in DAC960_V1_ReadControllerConfiguration()
1737 Controller->V1.GeometryTranslationHeads = 128; in DAC960_V1_ReadControllerConfiguration()
1738 Controller->V1.GeometryTranslationSectors = 32; in DAC960_V1_ReadControllerConfiguration()
1741 Controller->V1.GeometryTranslationHeads = 255; in DAC960_V1_ReadControllerConfiguration()
1742 Controller->V1.GeometryTranslationSectors = 63; in DAC960_V1_ReadControllerConfiguration()
1745 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1746 return DAC960_Failure(Controller, "CONFIG2 DRIVE GEOMETRY"); in DAC960_V1_ReadControllerConfiguration()
1751 if ((Controller->FirmwareVersion[0] == '4' && in DAC960_V1_ReadControllerConfiguration()
1752 strcmp(Controller->FirmwareVersion, "4.08") >= 0) || in DAC960_V1_ReadControllerConfiguration()
1753 (Controller->FirmwareVersion[0] == '5' && in DAC960_V1_ReadControllerConfiguration()
1754 strcmp(Controller->FirmwareVersion, "5.08") >= 0)) in DAC960_V1_ReadControllerConfiguration()
1756 Controller->V1.BackgroundInitializationStatusSupported = true; in DAC960_V1_ReadControllerConfiguration()
1757 DAC960_V1_ExecuteType3B(Controller, in DAC960_V1_ReadControllerConfiguration()
1759 Controller-> in DAC960_V1_ReadControllerConfiguration()
1761 memcpy(&Controller->V1.LastBackgroundInitializationStatus, in DAC960_V1_ReadControllerConfiguration()
1762 Controller->V1.BackgroundInitializationStatus, in DAC960_V1_ReadControllerConfiguration()
1769 LogicalDriveNumber < Controller->LogicalDriveCount; in DAC960_V1_ReadControllerConfiguration()
1771 if (Controller->V1.LogicalDriveInformation in DAC960_V1_ReadControllerConfiguration()
1774 Controller->LogicalDriveInitiallyAccessible[LogicalDriveNumber] = true; in DAC960_V1_ReadControllerConfiguration()
1775 Controller->V1.LastRebuildStatus = DAC960_V1_NoRebuildOrCheckInProgress; in DAC960_V1_ReadControllerConfiguration()
1776 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadControllerConfiguration()
1787 *Controller) in DAC960_V2_ReadControllerConfiguration() argument
1790 &Controller->V2.ControllerInformation; in DAC960_V2_ReadControllerConfiguration()
1795 if (!DAC960_V2_NewControllerInfo(Controller)) in DAC960_V2_ReadControllerConfiguration()
1796 return DAC960_Failure(Controller, "GET CONTROLLER INFO"); in DAC960_V2_ReadControllerConfiguration()
1797 memcpy(ControllerInfo, Controller->V2.NewControllerInformation, in DAC960_V2_ReadControllerConfiguration()
1801 if (!DAC960_V2_GeneralInfo(Controller)) in DAC960_V2_ReadControllerConfiguration()
1802 return DAC960_Failure(Controller, "GET HEALTH STATUS"); in DAC960_V2_ReadControllerConfiguration()
1808 if (ModelNameLength > sizeof(Controller->ModelName)-1) in DAC960_V2_ReadControllerConfiguration()
1809 ModelNameLength = sizeof(Controller->ModelName)-1; in DAC960_V2_ReadControllerConfiguration()
1810 memcpy(Controller->ModelName, ControllerInfo->ControllerName, in DAC960_V2_ReadControllerConfiguration()
1813 while (Controller->ModelName[ModelNameLength] == ' ' || in DAC960_V2_ReadControllerConfiguration()
1814 Controller->ModelName[ModelNameLength] == '\0') in DAC960_V2_ReadControllerConfiguration()
1816 Controller->ModelName[++ModelNameLength] = '\0'; in DAC960_V2_ReadControllerConfiguration()
1817 strcpy(Controller->FullModelName, "Mylex "); in DAC960_V2_ReadControllerConfiguration()
1818 strcat(Controller->FullModelName, Controller->ModelName); in DAC960_V2_ReadControllerConfiguration()
1822 sprintf(Controller->FirmwareVersion, "%d.%02d-%02d", in DAC960_V2_ReadControllerConfiguration()
1831 Controller, Controller->FirmwareVersion); in DAC960_V2_ReadControllerConfiguration()
1833 Controller); in DAC960_V2_ReadControllerConfiguration()
1835 Controller); in DAC960_V2_ReadControllerConfiguration()
1840 Controller->Channels = ControllerInfo->NumberOfPhysicalChannelsPresent; in DAC960_V2_ReadControllerConfiguration()
1841 Controller->Targets = in DAC960_V2_ReadControllerConfiguration()
1844 Controller->MemorySize = ControllerInfo->MemorySizeMB; in DAC960_V2_ReadControllerConfiguration()
1852 Controller->ControllerQueueDepth = ControllerInfo->MaximumParallelCommands; in DAC960_V2_ReadControllerConfiguration()
1853 Controller->DriverQueueDepth = Controller->ControllerQueueDepth - 1; in DAC960_V2_ReadControllerConfiguration()
1854 if (Controller->DriverQueueDepth > DAC960_MaxDriverQueueDepth) in DAC960_V2_ReadControllerConfiguration()
1855 Controller->DriverQueueDepth = DAC960_MaxDriverQueueDepth; in DAC960_V2_ReadControllerConfiguration()
1856 Controller->LogicalDriveCount = ControllerInfo->LogicalDevicesPresent; in DAC960_V2_ReadControllerConfiguration()
1857 Controller->MaxBlocksPerCommand = in DAC960_V2_ReadControllerConfiguration()
1859 Controller->ControllerScatterGatherLimit = in DAC960_V2_ReadControllerConfiguration()
1861 Controller->DriverScatterGatherLimit = in DAC960_V2_ReadControllerConfiguration()
1862 Controller->ControllerScatterGatherLimit; in DAC960_V2_ReadControllerConfiguration()
1863 if (Controller->DriverScatterGatherLimit > DAC960_V2_ScatterGatherLimit) in DAC960_V2_ReadControllerConfiguration()
1864 Controller->DriverScatterGatherLimit = DAC960_V2_ScatterGatherLimit; in DAC960_V2_ReadControllerConfiguration()
1871 Controller->V2.NewLogicalDeviceInformation; in DAC960_V2_ReadControllerConfiguration()
1875 if (!DAC960_V2_NewLogicalDeviceInfo(Controller, LogicalDeviceNumber)) in DAC960_V2_ReadControllerConfiguration()
1880 Controller, LogicalDeviceNumber); in DAC960_V2_ReadControllerConfiguration()
1885 Controller, NewLogicalDeviceInfo->DeviceBlockSizeInBytes); in DAC960_V2_ReadControllerConfiguration()
1889 PhysicalDevice.Controller = 0; in DAC960_V2_ReadControllerConfiguration()
1893 Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] = in DAC960_V2_ReadControllerConfiguration()
1897 Controller->LogicalDriveInitiallyAccessible[LogicalDeviceNumber] = true; in DAC960_V2_ReadControllerConfiguration()
1901 return DAC960_Failure(Controller, "LOGICAL DEVICE ALLOCATION"); in DAC960_V2_ReadControllerConfiguration()
1902 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] = in DAC960_V2_ReadControllerConfiguration()
1918 *Controller) in DAC960_ReportControllerConfiguration() argument
1921 Controller, Controller->ModelName); in DAC960_ReportControllerConfiguration()
1923 Controller, Controller->FirmwareVersion, in DAC960_ReportControllerConfiguration()
1924 Controller->Channels, Controller->MemorySize); in DAC960_ReportControllerConfiguration()
1926 Controller, Controller->Bus, in DAC960_ReportControllerConfiguration()
1927 Controller->Device, Controller->Function); in DAC960_ReportControllerConfiguration()
1928 if (Controller->IO_Address == 0) in DAC960_ReportControllerConfiguration()
1929 DAC960_Info("Unassigned\n", Controller); in DAC960_ReportControllerConfiguration()
1930 else DAC960_Info("0x%X\n", Controller, Controller->IO_Address); in DAC960_ReportControllerConfiguration()
1932 Controller, Controller->PCI_Address, in DAC960_ReportControllerConfiguration()
1933 (unsigned long) Controller->BaseAddress, in DAC960_ReportControllerConfiguration()
1934 Controller->IRQ_Channel); in DAC960_ReportControllerConfiguration()
1937 Controller, Controller->ControllerQueueDepth, in DAC960_ReportControllerConfiguration()
1938 Controller->MaxBlocksPerCommand); in DAC960_ReportControllerConfiguration()
1941 Controller, Controller->DriverQueueDepth, in DAC960_ReportControllerConfiguration()
1942 Controller->DriverScatterGatherLimit, in DAC960_ReportControllerConfiguration()
1943 Controller->ControllerScatterGatherLimit); in DAC960_ReportControllerConfiguration()
1944 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_ReportControllerConfiguration()
1947 "BIOS Geometry: %d/%d\n", Controller, in DAC960_ReportControllerConfiguration()
1948 Controller->V1.StripeSize, in DAC960_ReportControllerConfiguration()
1949 Controller->V1.SegmentSize, in DAC960_ReportControllerConfiguration()
1950 Controller->V1.GeometryTranslationHeads, in DAC960_ReportControllerConfiguration()
1951 Controller->V1.GeometryTranslationSectors); in DAC960_ReportControllerConfiguration()
1952 if (Controller->V1.SAFTE_EnclosureManagementEnabled) in DAC960_ReportControllerConfiguration()
1953 DAC960_Info(" SAF-TE Enclosure Management Enabled\n", Controller); in DAC960_ReportControllerConfiguration()
1967 *Controller) in DAC960_V1_ReadDeviceConfiguration()
1984 if (!init_dma_loaf(Controller->PCIDevice, &local_dma, in DAC960_V1_ReadDeviceConfiguration()
1988 return DAC960_Failure(Controller, in DAC960_V1_ReadDeviceConfiguration()
1991 for (Channel = 0; Channel < Controller->Channels; Channel++) { in DAC960_V1_ReadDeviceConfiguration()
2002 for (TargetID = 0; TargetID < Controller->Targets; TargetID++) in DAC960_V1_ReadDeviceConfiguration()
2010 for (Channel = 0; Channel < Controller->Channels; Channel++) in DAC960_V1_ReadDeviceConfiguration()
2015 DAC960_Command_T *Command = Controller->Commands[Channel]; in DAC960_V1_ReadDeviceConfiguration()
2043 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V1_ReadDeviceConfiguration()
2045 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V1_ReadDeviceConfiguration()
2052 for (Channel = 0; Channel < Controller->Channels; Channel++) in DAC960_V1_ReadDeviceConfiguration()
2055 &Controller->V1.InquiryStandardData[Channel][TargetID]; in DAC960_V1_ReadDeviceConfiguration()
2062 &Controller->V1.InquiryUnitSerialNumber[Channel][TargetID]; in DAC960_V1_ReadDeviceConfiguration()
2063 DAC960_Command_T *Command = Controller->Commands[Channel]; in DAC960_V1_ReadDeviceConfiguration()
2088 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V1_ReadDeviceConfiguration()
2090 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V1_ReadDeviceConfiguration()
2102 free_dma_loaf(Controller->PCIDevice, &local_dma); in DAC960_V1_ReadDeviceConfiguration()
2115 *Controller) in DAC960_V2_ReadDeviceConfiguration()
2123 Controller->V2.NewPhysicalDeviceInformation; in DAC960_V2_ReadDeviceConfiguration()
2126 Controller->V2.NewInquiryUnitSerialNumber; in DAC960_V2_ReadDeviceConfiguration()
2129 if (!DAC960_V2_NewPhysicalDeviceInfo(Controller, Channel, TargetID, LogicalUnit)) in DAC960_V2_ReadDeviceConfiguration()
2135 return DAC960_Failure(Controller, "PHYSICAL DEVICE ALLOCATION"); in DAC960_V2_ReadDeviceConfiguration()
2136 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex] = in DAC960_V2_ReadDeviceConfiguration()
2145 return DAC960_Failure(Controller, "SERIAL NUMBER ALLOCATION"); in DAC960_V2_ReadDeviceConfiguration()
2147 Controller->V2.InquiryUnitSerialNumber[PhysicalDeviceIndex] = in DAC960_V2_ReadDeviceConfiguration()
2160 if (!DAC960_V2_NewInquiryUnitSerialNumber(Controller, Channel, TargetID, LogicalUnit)) { in DAC960_V2_ReadDeviceConfiguration()
2239 *Controller) in DAC960_V1_ReportDeviceConfiguration()
2242 DAC960_Info(" Physical Devices:\n", Controller); in DAC960_V1_ReportDeviceConfiguration()
2243 for (Channel = 0; Channel < Controller->Channels; Channel++) in DAC960_V1_ReportDeviceConfiguration()
2244 for (TargetID = 0; TargetID < Controller->Targets; TargetID++) in DAC960_V1_ReportDeviceConfiguration()
2247 &Controller->V1.InquiryStandardData[Channel][TargetID]; in DAC960_V1_ReportDeviceConfiguration()
2249 &Controller->V1.InquiryUnitSerialNumber[Channel][TargetID]; in DAC960_V1_ReportDeviceConfiguration()
2251 &Controller->V1.DeviceState[Channel][TargetID]; in DAC960_V1_ReportDeviceConfiguration()
2253 &Controller->V1.ErrorTable.ErrorTableEntries[Channel][TargetID]; in DAC960_V1_ReportDeviceConfiguration()
2263 Controller, Channel, TargetID, (TargetID < 10 ? " " : ""), in DAC960_V1_ReportDeviceConfiguration()
2266 DAC960_Info(" Serial Number: %s\n", Controller, SerialNumber); in DAC960_V1_ReportDeviceConfiguration()
2270 if (Controller->V1.DeviceResetCount[Channel][TargetID] > 0) in DAC960_V1_ReportDeviceConfiguration()
2272 Controller, in DAC960_V1_ReportDeviceConfiguration()
2282 Controller->V1.DeviceResetCount[Channel][TargetID]); in DAC960_V1_ReportDeviceConfiguration()
2284 DAC960_Info(" Disk Status: %s, %u blocks\n", Controller, in DAC960_V1_ReportDeviceConfiguration()
2300 "Hard: %d, Misc: %d\n", Controller, in DAC960_V1_ReportDeviceConfiguration()
2306 DAC960_Info(" Logical Drives:\n", Controller); in DAC960_V1_ReportDeviceConfiguration()
2308 LogicalDriveNumber < Controller->LogicalDriveCount; in DAC960_V1_ReportDeviceConfiguration()
2312 &Controller->V1.LogicalDriveInformation[LogicalDriveNumber]; in DAC960_V1_ReportDeviceConfiguration()
2314 Controller, Controller->ControllerNumber, LogicalDriveNumber, in DAC960_V1_ReportDeviceConfiguration()
2336 *Controller) in DAC960_V2_ReportDeviceConfiguration()
2339 DAC960_Info(" Physical Devices:\n", Controller); in DAC960_V2_ReportDeviceConfiguration()
2345 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex]; in DAC960_V2_ReportDeviceConfiguration()
2349 Controller->V2.InquiryUnitSerialNumber[PhysicalDeviceIndex]; in DAC960_V2_ReportDeviceConfiguration()
2358 Controller, in DAC960_V2_ReportDeviceConfiguration()
2364 DAC960_Info(" %sAsynchronous\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2368 DAC960_Info(" %sSynchronous at %d MB/sec\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2374 DAC960_Info(" Serial Number: %s\n", Controller, SerialNumber); in DAC960_V2_ReportDeviceConfiguration()
2378 DAC960_Info(" Disk Status: %s, %u blocks\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2414 "Hard: %d, Misc: %d\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2420 "Aborts: %d, Predicted: %d\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2426 DAC960_Info(" Logical Drives:\n", Controller); in DAC960_V2_ReportDeviceConfiguration()
2432 Controller->V2.LogicalDeviceInformation[LogicalDriveNumber]; in DAC960_V2_ReportDeviceConfiguration()
2456 Controller, LogicalDeviceInfo->DriveGeometry); in DAC960_V2_ReportDeviceConfiguration()
2460 Controller, Controller->ControllerNumber, LogicalDriveNumber, in DAC960_V2_ReportDeviceConfiguration()
2470 Controller, in DAC960_V2_ReportDeviceConfiguration()
2479 "Segment Size: N/A\n", Controller); in DAC960_V2_ReportDeviceConfiguration()
2482 "Segment Size: %dKB\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2489 "Segment Size: N/A\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2493 "Segment Size: %dKB\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2497 DAC960_Info(" %s, %s\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2506 "Deferred Write: %d\n", Controller, in DAC960_V2_ReportDeviceConfiguration()
2520 static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller) in DAC960_RegisterBlockDevice() argument
2522 int MajorNumber = DAC960_MAJOR + Controller->ControllerNumber; in DAC960_RegisterBlockDevice()
2532 struct gendisk *disk = Controller->disks[n]; in DAC960_RegisterBlockDevice()
2536 RequestQueue = blk_init_queue(DAC960_RequestFunction,&Controller->queue_lock); in DAC960_RegisterBlockDevice()
2541 Controller->RequestQueue[n] = RequestQueue; in DAC960_RegisterBlockDevice()
2542 blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit); in DAC960_RegisterBlockDevice()
2543 RequestQueue->queuedata = Controller; in DAC960_RegisterBlockDevice()
2544 blk_queue_max_segments(RequestQueue, Controller->DriverScatterGatherLimit); in DAC960_RegisterBlockDevice()
2545 blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand); in DAC960_RegisterBlockDevice()
2547 sprintf(disk->disk_name, "rd/c%dd%d", Controller->ControllerNumber, n); in DAC960_RegisterBlockDevice()
2564 static void DAC960_UnregisterBlockDevice(DAC960_Controller_T *Controller) in DAC960_UnregisterBlockDevice() argument
2566 int MajorNumber = DAC960_MAJOR + Controller->ControllerNumber; in DAC960_UnregisterBlockDevice()
2571 del_gendisk(Controller->disks[disk]); in DAC960_UnregisterBlockDevice()
2572 blk_cleanup_queue(Controller->RequestQueue[disk]); in DAC960_UnregisterBlockDevice()
2573 Controller->RequestQueue[disk] = NULL; in DAC960_UnregisterBlockDevice()
2587 static void DAC960_ComputeGenericDiskInfo(DAC960_Controller_T *Controller) in DAC960_ComputeGenericDiskInfo() argument
2591 set_capacity(Controller->disks[disk], disk_size(Controller, disk)); in DAC960_ComputeGenericDiskInfo()
2600 static bool DAC960_ReportErrorStatus(DAC960_Controller_T *Controller, in DAC960_ReportErrorStatus() argument
2609 Controller, Parameter1, Parameter0); in DAC960_ReportErrorStatus()
2612 if (Controller->DriveSpinUpMessageDisplayed) break; in DAC960_ReportErrorStatus()
2613 DAC960_Notice("Spinning Up Drives\n", Controller); in DAC960_ReportErrorStatus()
2614 Controller->DriveSpinUpMessageDisplayed = true; in DAC960_ReportErrorStatus()
2617 DAC960_Notice("Configuration Checksum Error\n", Controller); in DAC960_ReportErrorStatus()
2620 DAC960_Notice("Mirror Race Recovery Failed\n", Controller); in DAC960_ReportErrorStatus()
2623 DAC960_Notice("Mirror Race Recovery In Progress\n", Controller); in DAC960_ReportErrorStatus()
2627 Controller, Parameter1, Parameter0); in DAC960_ReportErrorStatus()
2630 DAC960_Notice("Logical Drive Installation Aborted\n", Controller); in DAC960_ReportErrorStatus()
2633 DAC960_Notice("Mirror Race On A Critical Logical Drive\n", Controller); in DAC960_ReportErrorStatus()
2636 DAC960_Notice("New Controller Configuration Found\n", Controller); in DAC960_ReportErrorStatus()
2639 DAC960_Error("Fatal Memory Parity Error for Controller at\n", Controller); in DAC960_ReportErrorStatus()
2643 Controller, ErrorStatus); in DAC960_ReportErrorStatus()
2659 static void DAC960_DetectCleanup(DAC960_Controller_T *Controller) in DAC960_DetectCleanup() argument
2664 free_dma_loaf(Controller->PCIDevice, &Controller->DmaPages); in DAC960_DetectCleanup()
2665 if (Controller->MemoryMappedAddress) { in DAC960_DetectCleanup()
2666 switch(Controller->HardwareType) in DAC960_DetectCleanup()
2669 DAC960_GEM_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2672 DAC960_BA_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2675 DAC960_LP_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2678 DAC960_LA_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2681 DAC960_PG_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2684 DAC960_PD_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2687 DAC960_PD_DisableInterrupts(Controller->BaseAddress); in DAC960_DetectCleanup()
2690 iounmap(Controller->MemoryMappedAddress); in DAC960_DetectCleanup()
2692 if (Controller->IRQ_Channel) in DAC960_DetectCleanup()
2693 free_irq(Controller->IRQ_Channel, Controller); in DAC960_DetectCleanup()
2694 if (Controller->IO_Address) in DAC960_DetectCleanup()
2695 release_region(Controller->IO_Address, 0x80); in DAC960_DetectCleanup()
2696 pci_disable_device(Controller->PCIDevice); in DAC960_DetectCleanup()
2697 for (i = 0; (i < DAC960_MaxLogicalDrives) && Controller->disks[i]; i++) in DAC960_DetectCleanup()
2698 put_disk(Controller->disks[i]); in DAC960_DetectCleanup()
2699 DAC960_Controllers[Controller->ControllerNumber] = NULL; in DAC960_DetectCleanup()
2700 kfree(Controller); in DAC960_DetectCleanup()
2718 DAC960_Controller_T *Controller = NULL; in DAC960_DetectController() local
2725 Controller = kzalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC); in DAC960_DetectController()
2726 if (Controller == NULL) { in DAC960_DetectController()
2731 Controller->ControllerNumber = DAC960_ControllerCount; in DAC960_DetectController()
2732 DAC960_Controllers[DAC960_ControllerCount++] = Controller; in DAC960_DetectController()
2733 Controller->Bus = PCI_Device->bus->number; in DAC960_DetectController()
2734 Controller->FirmwareType = privdata->FirmwareType; in DAC960_DetectController()
2735 Controller->HardwareType = privdata->HardwareType; in DAC960_DetectController()
2736 Controller->Device = DeviceFunction >> 3; in DAC960_DetectController()
2737 Controller->Function = DeviceFunction & 0x7; in DAC960_DetectController()
2738 Controller->PCIDevice = PCI_Device; in DAC960_DetectController()
2739 strcpy(Controller->FullModelName, "DAC960"); in DAC960_DetectController()
2744 switch (Controller->HardwareType) in DAC960_DetectController()
2747 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2750 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2753 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2756 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2759 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2762 Controller->IO_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2763 Controller->PCI_Address = pci_resource_start(PCI_Device, 1); in DAC960_DetectController()
2766 Controller->IO_Address = pci_resource_start(PCI_Device, 0); in DAC960_DetectController()
2767 Controller->PCI_Address = pci_resource_start(PCI_Device, 1); in DAC960_DetectController()
2771 pci_set_drvdata(PCI_Device, (void *)((long)Controller->ControllerNumber)); in DAC960_DetectController()
2773 Controller->disks[i] = alloc_disk(1<<DAC960_MaxPartitionsBits); in DAC960_DetectController()
2774 if (!Controller->disks[i]) in DAC960_DetectController()
2776 Controller->disks[i]->private_data = (void *)((long)i); in DAC960_DetectController()
2778 init_waitqueue_head(&Controller->CommandWaitQueue); in DAC960_DetectController()
2779 init_waitqueue_head(&Controller->HealthStatusWaitQueue); in DAC960_DetectController()
2780 spin_lock_init(&Controller->queue_lock); in DAC960_DetectController()
2781 DAC960_AnnounceDriver(Controller); in DAC960_DetectController()
2787 Controller->MemoryMappedAddress = in DAC960_DetectController()
2788 ioremap_nocache(Controller->PCI_Address & PAGE_MASK, MemoryWindowSize); in DAC960_DetectController()
2789 Controller->BaseAddress = in DAC960_DetectController()
2790 Controller->MemoryMappedAddress + (Controller->PCI_Address & ~PAGE_MASK); in DAC960_DetectController()
2791 if (Controller->MemoryMappedAddress == NULL) in DAC960_DetectController()
2794 "Controller at\n", Controller); in DAC960_DetectController()
2797 BaseAddress = Controller->BaseAddress; in DAC960_DetectController()
2798 switch (Controller->HardwareType) in DAC960_DetectController()
2808 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2813 if (!DAC960_V2_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2816 "for Controller at\n", Controller); in DAC960_DetectController()
2820 Controller->QueueCommand = DAC960_GEM_QueueCommand; in DAC960_DetectController()
2821 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2823 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2825 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2827 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2838 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2843 if (!DAC960_V2_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2846 "for Controller at\n", Controller); in DAC960_DetectController()
2850 Controller->QueueCommand = DAC960_BA_QueueCommand; in DAC960_DetectController()
2851 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2853 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2855 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2857 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2868 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2873 if (!DAC960_V2_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2876 "for Controller at\n", Controller); in DAC960_DetectController()
2880 Controller->QueueCommand = DAC960_LP_QueueCommand; in DAC960_DetectController()
2881 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2883 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2885 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2887 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2898 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2903 if (!DAC960_V1_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2906 "for Controller at\n", Controller); in DAC960_DetectController()
2910 if (Controller->V1.DualModeMemoryMailboxInterface) in DAC960_DetectController()
2911 Controller->QueueCommand = DAC960_LA_QueueCommandDualMode; in DAC960_DetectController()
2912 else Controller->QueueCommand = DAC960_LA_QueueCommandSingleMode; in DAC960_DetectController()
2913 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2915 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2917 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2919 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2930 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2935 if (!DAC960_V1_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2938 "for Controller at\n", Controller); in DAC960_DetectController()
2942 if (Controller->V1.DualModeMemoryMailboxInterface) in DAC960_DetectController()
2943 Controller->QueueCommand = DAC960_PG_QueueCommandDualMode; in DAC960_DetectController()
2944 else Controller->QueueCommand = DAC960_PG_QueueCommandSingleMode; in DAC960_DetectController()
2945 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2947 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2949 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2951 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2955 if (!request_region(Controller->IO_Address, 0x80, in DAC960_DetectController()
2956 Controller->FullModelName)) { in DAC960_DetectController()
2958 Controller, Controller->IO_Address); in DAC960_DetectController()
2968 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
2973 if (!DAC960_V1_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
2976 "for Controller at\n", Controller); in DAC960_DetectController()
2980 Controller->QueueCommand = DAC960_PD_QueueCommand; in DAC960_DetectController()
2981 Controller->ReadControllerConfiguration = in DAC960_DetectController()
2983 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
2985 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
2987 Controller->QueueReadWriteCommand = in DAC960_DetectController()
2991 if (!request_region(Controller->IO_Address, 0x80, in DAC960_DetectController()
2992 Controller->FullModelName)){ in DAC960_DetectController()
2994 Controller, Controller->IO_Address); in DAC960_DetectController()
3004 DAC960_ReportErrorStatus(Controller, ErrorStatus, in DAC960_DetectController()
3009 if (!DAC960_V1_EnableMemoryMailboxInterface(Controller)) in DAC960_DetectController()
3012 "for Controller at\n", Controller); in DAC960_DetectController()
3016 Controller->QueueCommand = DAC960_P_QueueCommand; in DAC960_DetectController()
3017 Controller->ReadControllerConfiguration = in DAC960_DetectController()
3019 Controller->ReadDeviceConfiguration = in DAC960_DetectController()
3021 Controller->ReportDeviceConfiguration = in DAC960_DetectController()
3023 Controller->QueueReadWriteCommand = in DAC960_DetectController()
3032 Controller->FullModelName, Controller) < 0) in DAC960_DetectController()
3035 Controller, Controller->IRQ_Channel); in DAC960_DetectController()
3038 Controller->IRQ_Channel = IRQ_Channel; in DAC960_DetectController()
3039 Controller->InitialCommand.CommandIdentifier = 1; in DAC960_DetectController()
3040 Controller->InitialCommand.Controller = Controller; in DAC960_DetectController()
3041 Controller->Commands[0] = &Controller->InitialCommand; in DAC960_DetectController()
3042 Controller->FreeCommands = &Controller->InitialCommand; in DAC960_DetectController()
3043 return Controller; in DAC960_DetectController()
3046 if (Controller->IO_Address == 0) in DAC960_DetectController()
3048 "PCI Address 0x%X\n", Controller, in DAC960_DetectController()
3049 Controller->Bus, Controller->Device, in DAC960_DetectController()
3050 Controller->Function, Controller->PCI_Address); in DAC960_DetectController()
3053 "0x%X PCI Address 0x%X\n", Controller, in DAC960_DetectController()
3054 Controller->Bus, Controller->Device, in DAC960_DetectController()
3055 Controller->Function, Controller->IO_Address, in DAC960_DetectController()
3056 Controller->PCI_Address); in DAC960_DetectController()
3057 DAC960_DetectCleanup(Controller); in DAC960_DetectController()
3067 DAC960_InitializeController(DAC960_Controller_T *Controller) in DAC960_InitializeController() argument
3069 if (DAC960_ReadControllerConfiguration(Controller) && in DAC960_InitializeController()
3070 DAC960_ReportControllerConfiguration(Controller) && in DAC960_InitializeController()
3071 DAC960_CreateAuxiliaryStructures(Controller) && in DAC960_InitializeController()
3072 DAC960_ReadDeviceConfiguration(Controller) && in DAC960_InitializeController()
3073 DAC960_ReportDeviceConfiguration(Controller) && in DAC960_InitializeController()
3074 DAC960_RegisterBlockDevice(Controller)) in DAC960_InitializeController()
3079 init_timer(&Controller->MonitoringTimer); in DAC960_InitializeController()
3080 Controller->MonitoringTimer.expires = in DAC960_InitializeController()
3082 Controller->MonitoringTimer.data = (unsigned long) Controller; in DAC960_InitializeController()
3083 Controller->MonitoringTimer.function = DAC960_MonitoringTimerFunction; 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
4370 DAC960_Error("Error Condition %s on %s:\n", Controller, in DAC960_V2_ReadWriteError()
4373 Controller, Controller->ControllerNumber, in DAC960_V2_ReadWriteError()
4384 static void DAC960_V2_ReportEvent(DAC960_Controller_T *Controller, in DAC960_V2_ReportEvent() argument
4530 Controller, Event->EventCode); in DAC960_V2_ReportEvent()
4536 DAC960_Critical("Physical Device %d:%d %s\n", Controller, in DAC960_V2_ReportEvent()
4540 DAC960_Critical("Logical Drive %d (/dev/rd/c%dd%d) %s\n", Controller, in DAC960_V2_ReportEvent()
4541 Event->LogicalUnit, Controller->ControllerNumber, in DAC960_V2_ReportEvent()
4545 DAC960_Progress("Logical Drive %d (/dev/rd/c%dd%d) %s\n", Controller, in DAC960_V2_ReportEvent()
4546 Event->LogicalUnit, Controller->ControllerNumber, in DAC960_V2_ReportEvent()
4556 DAC960_Critical("Physical Device %d:%d %s\n", Controller, in DAC960_V2_ReportEvent()
4560 Controller, in DAC960_V2_ReportEvent()
4569 Controller, in DAC960_V2_ReportEvent()
4582 if (Controller->SuppressEnclosureMessages) break; in DAC960_V2_ReportEvent()
4584 DAC960_Critical("Enclosure %d %s\n", Controller, in DAC960_V2_ReportEvent()
4588 DAC960_Critical("Controller %s\n", Controller, EventMessage); in DAC960_V2_ReportEvent()
4592 Controller, Event->EventCode); in DAC960_V2_ReportEvent()
4603 static void DAC960_V2_ReportProgress(DAC960_Controller_T *Controller, in DAC960_V2_ReportProgress() argument
4609 Controller->EphemeralProgressMessage = true; in DAC960_V2_ReportProgress()
4611 "%d%% completed\n", Controller, in DAC960_V2_ReportProgress()
4614 Controller->ControllerNumber, in DAC960_V2_ReportProgress()
4617 Controller->EphemeralProgressMessage = false; in DAC960_V2_ReportProgress()
4628 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V2_ProcessCompletedCommand() local
4702 if (Controller->ShutdownMonitoringTimer) in DAC960_V2_ProcessCompletedCommand()
4707 Controller->V2.NewControllerInformation; in DAC960_V2_ProcessCompletedCommand()
4709 &Controller->V2.ControllerInformation; in DAC960_V2_ProcessCompletedCommand()
4710 Controller->LogicalDriveCount = in DAC960_V2_ProcessCompletedCommand()
4712 Controller->V2.NeedLogicalDeviceInformation = true; in DAC960_V2_ProcessCompletedCommand()
4713 Controller->V2.NeedPhysicalDeviceInformation = true; in DAC960_V2_ProcessCompletedCommand()
4714 Controller->V2.StartLogicalDeviceInformationScan = true; in DAC960_V2_ProcessCompletedCommand()
4715 Controller->V2.StartPhysicalDeviceInformationScan = true; in DAC960_V2_ProcessCompletedCommand()
4716 Controller->MonitoringAlertMode = in DAC960_V2_ProcessCompletedCommand()
4727 DAC960_V2_ReportEvent(Controller, Controller->V2.Event); in DAC960_V2_ProcessCompletedCommand()
4729 Controller->V2.NextEventSequenceNumber++; in DAC960_V2_ProcessCompletedCommand()
4735 Controller->V2.NewPhysicalDeviceInformation; in DAC960_V2_ProcessCompletedCommand()
4736 unsigned int PhysicalDeviceIndex = Controller->V2.PhysicalDeviceIndex; in DAC960_V2_ProcessCompletedCommand()
4738 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4740 Controller->V2.InquiryUnitSerialNumber[PhysicalDeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4755 Controller, in DAC960_V2_ProcessCompletedCommand()
4758 Controller->V2.PhysicalDeviceInformation in DAC960_V2_ProcessCompletedCommand()
4760 Controller->V2.InquiryUnitSerialNumber in DAC960_V2_ProcessCompletedCommand()
4768 Controller->V2.PhysicalDeviceInformation[DeviceIndex] = in DAC960_V2_ProcessCompletedCommand()
4769 Controller->V2.PhysicalDeviceInformation[DeviceIndex+1]; in DAC960_V2_ProcessCompletedCommand()
4770 Controller->V2.InquiryUnitSerialNumber[DeviceIndex] = in DAC960_V2_ProcessCompletedCommand()
4771 Controller->V2.InquiryUnitSerialNumber[DeviceIndex+1]; in DAC960_V2_ProcessCompletedCommand()
4773 Controller->V2.PhysicalDeviceInformation in DAC960_V2_ProcessCompletedCommand()
4775 Controller->V2.InquiryUnitSerialNumber in DAC960_V2_ProcessCompletedCommand()
4778 Controller->V2.PhysicalDeviceInformation[PhysicalDeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4780 Controller->V2.InquiryUnitSerialNumber[PhysicalDeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4804 Controller, in DAC960_V2_ProcessCompletedCommand()
4822 Controller->V2.PhysicalDeviceInformation[DeviceIndex] = in DAC960_V2_ProcessCompletedCommand()
4823 Controller->V2.PhysicalDeviceInformation[DeviceIndex-1]; in DAC960_V2_ProcessCompletedCommand()
4824 Controller->V2.InquiryUnitSerialNumber[DeviceIndex] = in DAC960_V2_ProcessCompletedCommand()
4825 Controller->V2.InquiryUnitSerialNumber[DeviceIndex-1]; in DAC960_V2_ProcessCompletedCommand()
4827 Controller->V2.PhysicalDeviceInformation in DAC960_V2_ProcessCompletedCommand()
4830 Controller->V2.InquiryUnitSerialNumber in DAC960_V2_ProcessCompletedCommand()
4833 Controller->V2.NeedDeviceSerialNumberInformation = true; in DAC960_V2_ProcessCompletedCommand()
4841 "Physical Device %d:%d is now %s\n", Controller, in DAC960_V2_ProcessCompletedCommand()
4888 Controller, in DAC960_V2_ProcessCompletedCommand()
4898 Controller, in DAC960_V2_ProcessCompletedCommand()
4913 Controller->V2.NeedDeviceSerialNumberInformation = true; in DAC960_V2_ProcessCompletedCommand()
4918 Controller->V2.PhysicalDeviceIndex++; in DAC960_V2_ProcessCompletedCommand()
4923 for (DeviceIndex = Controller->V2.PhysicalDeviceIndex; in DAC960_V2_ProcessCompletedCommand()
4928 Controller->V2.PhysicalDeviceInformation[DeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4930 Controller->V2.InquiryUnitSerialNumber[DeviceIndex]; in DAC960_V2_ProcessCompletedCommand()
4933 Controller, in DAC960_V2_ProcessCompletedCommand()
4936 Controller->V2.PhysicalDeviceInformation[DeviceIndex] = NULL; in DAC960_V2_ProcessCompletedCommand()
4937 Controller->V2.InquiryUnitSerialNumber[DeviceIndex] = NULL; in DAC960_V2_ProcessCompletedCommand()
4941 Controller->V2.NeedPhysicalDeviceInformation = false; in DAC960_V2_ProcessCompletedCommand()
4947 Controller->V2.NewLogicalDeviceInformation; in DAC960_V2_ProcessCompletedCommand()
4951 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber]; in DAC960_V2_ProcessCompletedCommand()
4955 PhysicalDevice.Controller = 0; in DAC960_V2_ProcessCompletedCommand()
4959 Controller->V2.LogicalDriveToVirtualDevice[LogicalDeviceNumber] = in DAC960_V2_ProcessCompletedCommand()
4963 Controller->V2.LogicalDeviceInformation[LogicalDeviceNumber] = in DAC960_V2_ProcessCompletedCommand()
4966 "Now Exists%s\n", Controller, in DAC960_V2_ProcessCompletedCommand()
4968 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
4976 DAC960_ComputeGenericDiskInfo(Controller); in DAC960_V2_ProcessCompletedCommand()
4986 "is now %s\n", Controller, in DAC960_V2_ProcessCompletedCommand()
4988 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
5004 Controller, LogicalDeviceNumber, in DAC960_V2_ProcessCompletedCommand()
5005 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
5011 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5018 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5025 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5032 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5039 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5046 DAC960_V2_ReportProgress(Controller, in DAC960_V2_ProcessCompletedCommand()
5056 Controller, in DAC960_V2_ProcessCompletedCommand()
5058 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
5066 Controller->V2.LogicalDriveFoundDuringScan in DAC960_V2_ProcessCompletedCommand()
5078 Controller->V2.LogicalDeviceInformation[LogicalDriveNumber]; in DAC960_V2_ProcessCompletedCommand()
5080 Controller->V2.LogicalDriveFoundDuringScan in DAC960_V2_ProcessCompletedCommand()
5084 "No Longer Exists\n", Controller, in DAC960_V2_ProcessCompletedCommand()
5086 Controller->ControllerNumber, in DAC960_V2_ProcessCompletedCommand()
5088 Controller->V2.LogicalDeviceInformation in DAC960_V2_ProcessCompletedCommand()
5091 Controller->LogicalDriveInitiallyAccessible in DAC960_V2_ProcessCompletedCommand()
5093 DAC960_ComputeGenericDiskInfo(Controller); in DAC960_V2_ProcessCompletedCommand()
5095 Controller->V2.NeedLogicalDeviceInformation = false; in DAC960_V2_ProcessCompletedCommand()
5100 Controller->V2.InquiryUnitSerialNumber[Controller->V2.PhysicalDeviceIndex - 1]; in DAC960_V2_ProcessCompletedCommand()
5108 Controller->V2.NewInquiryUnitSerialNumber, in DAC960_V2_ProcessCompletedCommand()
5111 Controller->V2.NeedDeviceSerialNumberInformation = false; in DAC960_V2_ProcessCompletedCommand()
5114 if (Controller->V2.HealthStatusBuffer->NextEventSequenceNumber in DAC960_V2_ProcessCompletedCommand()
5115 - Controller->V2.NextEventSequenceNumber > 0) in DAC960_V2_ProcessCompletedCommand()
5120 Controller->V2.NextEventSequenceNumber >> 16; in DAC960_V2_ProcessCompletedCommand()
5125 Controller->V2.NextEventSequenceNumber & 0xFFFF; in DAC960_V2_ProcessCompletedCommand()
5129 Controller->V2.EventDMA; in DAC960_V2_ProcessCompletedCommand()
5137 if (Controller->V2.NeedPhysicalDeviceInformation) in DAC960_V2_ProcessCompletedCommand()
5139 if (Controller->V2.NeedDeviceSerialNumberInformation) in DAC960_V2_ProcessCompletedCommand()
5142 Controller->V2.NewInquiryUnitSerialNumber; in DAC960_V2_ProcessCompletedCommand()
5145 DAC960_V2_ConstructNewUnitSerialNumber(Controller, CommandMailbox, in DAC960_V2_ProcessCompletedCommand()
5146 Controller->V2.NewPhysicalDeviceInformation->Channel, in DAC960_V2_ProcessCompletedCommand()
5147 Controller->V2.NewPhysicalDeviceInformation->TargetID, in DAC960_V2_ProcessCompletedCommand()
5148 Controller->V2.NewPhysicalDeviceInformation->LogicalUnit - 1); in DAC960_V2_ProcessCompletedCommand()
5154 if (Controller->V2.StartPhysicalDeviceInformationScan) in DAC960_V2_ProcessCompletedCommand()
5156 Controller->V2.PhysicalDeviceIndex = 0; in DAC960_V2_ProcessCompletedCommand()
5157 Controller->V2.NewPhysicalDeviceInformation->Channel = 0; in DAC960_V2_ProcessCompletedCommand()
5158 Controller->V2.NewPhysicalDeviceInformation->TargetID = 0; in DAC960_V2_ProcessCompletedCommand()
5159 Controller->V2.NewPhysicalDeviceInformation->LogicalUnit = 0; in DAC960_V2_ProcessCompletedCommand()
5160 Controller->V2.StartPhysicalDeviceInformationScan = false; in DAC960_V2_ProcessCompletedCommand()
5166 Controller->V2.NewPhysicalDeviceInformation->LogicalUnit; in DAC960_V2_ProcessCompletedCommand()
5168 Controller->V2.NewPhysicalDeviceInformation->TargetID; in DAC960_V2_ProcessCompletedCommand()
5170 Controller->V2.NewPhysicalDeviceInformation->Channel; in DAC960_V2_ProcessCompletedCommand()
5176 Controller->V2.NewPhysicalDeviceInformationDMA; in DAC960_V2_ProcessCompletedCommand()
5184 if (Controller->V2.NeedLogicalDeviceInformation) in DAC960_V2_ProcessCompletedCommand()
5186 if (Controller->V2.StartLogicalDeviceInformationScan) in DAC960_V2_ProcessCompletedCommand()
5192 Controller->V2.LogicalDriveFoundDuringScan in DAC960_V2_ProcessCompletedCommand()
5194 Controller->V2.NewLogicalDeviceInformation->LogicalDeviceNumber = 0; in DAC960_V2_ProcessCompletedCommand()
5195 Controller->V2.StartLogicalDeviceInformationScan = false; in DAC960_V2_ProcessCompletedCommand()
5201 Controller->V2.NewLogicalDeviceInformation->LogicalDeviceNumber; in DAC960_V2_ProcessCompletedCommand()
5207 Controller->V2.NewLogicalDeviceInformationDMA; in DAC960_V2_ProcessCompletedCommand()
5215 Controller->MonitoringTimerCount++; in DAC960_V2_ProcessCompletedCommand()
5216 Controller->MonitoringTimer.expires = in DAC960_V2_ProcessCompletedCommand()
5218 add_timer(&Controller->MonitoringTimer); in DAC960_V2_ProcessCompletedCommand()
5242 if (Controller->MonitoringCommandDeferred) in DAC960_V2_ProcessCompletedCommand()
5244 Controller->MonitoringCommandDeferred = false; in DAC960_V2_ProcessCompletedCommand()
5255 wake_up(&Controller->CommandWaitQueue); in DAC960_V2_ProcessCompletedCommand()
5266 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_GEM_InterruptHandler() local
5267 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_GEM_InterruptHandler()
5271 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_GEM_InterruptHandler()
5273 NextStatusMailbox = Controller->V2.NextStatusMailbox; in DAC960_GEM_InterruptHandler()
5278 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_GEM_InterruptHandler()
5285 if (++NextStatusMailbox > Controller->V2.LastStatusMailbox) in DAC960_GEM_InterruptHandler()
5286 NextStatusMailbox = Controller->V2.FirstStatusMailbox; in DAC960_GEM_InterruptHandler()
5289 Controller->V2.NextStatusMailbox = NextStatusMailbox; in DAC960_GEM_InterruptHandler()
5294 DAC960_ProcessRequest(Controller); in DAC960_GEM_InterruptHandler()
5295 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_GEM_InterruptHandler()
5307 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_BA_InterruptHandler() local
5308 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_BA_InterruptHandler()
5312 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_BA_InterruptHandler()
5314 NextStatusMailbox = Controller->V2.NextStatusMailbox; in DAC960_BA_InterruptHandler()
5319 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_BA_InterruptHandler()
5326 if (++NextStatusMailbox > Controller->V2.LastStatusMailbox) in DAC960_BA_InterruptHandler()
5327 NextStatusMailbox = Controller->V2.FirstStatusMailbox; in DAC960_BA_InterruptHandler()
5330 Controller->V2.NextStatusMailbox = NextStatusMailbox; in DAC960_BA_InterruptHandler()
5335 DAC960_ProcessRequest(Controller); in DAC960_BA_InterruptHandler()
5336 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_BA_InterruptHandler()
5349 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_LP_InterruptHandler() local
5350 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LP_InterruptHandler()
5354 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_LP_InterruptHandler()
5356 NextStatusMailbox = Controller->V2.NextStatusMailbox; in DAC960_LP_InterruptHandler()
5361 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_LP_InterruptHandler()
5368 if (++NextStatusMailbox > Controller->V2.LastStatusMailbox) in DAC960_LP_InterruptHandler()
5369 NextStatusMailbox = Controller->V2.FirstStatusMailbox; in DAC960_LP_InterruptHandler()
5372 Controller->V2.NextStatusMailbox = NextStatusMailbox; in DAC960_LP_InterruptHandler()
5377 DAC960_ProcessRequest(Controller); in DAC960_LP_InterruptHandler()
5378 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_LP_InterruptHandler()
5391 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_LA_InterruptHandler() local
5392 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_LA_InterruptHandler()
5396 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_LA_InterruptHandler()
5398 NextStatusMailbox = Controller->V1.NextStatusMailbox; in DAC960_LA_InterruptHandler()
5403 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_LA_InterruptHandler()
5406 if (++NextStatusMailbox > Controller->V1.LastStatusMailbox) in DAC960_LA_InterruptHandler()
5407 NextStatusMailbox = Controller->V1.FirstStatusMailbox; in DAC960_LA_InterruptHandler()
5410 Controller->V1.NextStatusMailbox = NextStatusMailbox; in DAC960_LA_InterruptHandler()
5415 DAC960_ProcessRequest(Controller); in DAC960_LA_InterruptHandler()
5416 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_LA_InterruptHandler()
5429 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_PG_InterruptHandler() local
5430 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PG_InterruptHandler()
5434 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_PG_InterruptHandler()
5436 NextStatusMailbox = Controller->V1.NextStatusMailbox; in DAC960_PG_InterruptHandler()
5441 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_PG_InterruptHandler()
5444 if (++NextStatusMailbox > Controller->V1.LastStatusMailbox) in DAC960_PG_InterruptHandler()
5445 NextStatusMailbox = Controller->V1.FirstStatusMailbox; in DAC960_PG_InterruptHandler()
5448 Controller->V1.NextStatusMailbox = NextStatusMailbox; in DAC960_PG_InterruptHandler()
5453 DAC960_ProcessRequest(Controller); in DAC960_PG_InterruptHandler()
5454 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_PG_InterruptHandler()
5467 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_PD_InterruptHandler() local
5468 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_PD_InterruptHandler()
5471 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_PD_InterruptHandler()
5476 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_PD_InterruptHandler()
5487 DAC960_ProcessRequest(Controller); in DAC960_PD_InterruptHandler()
5488 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_PD_InterruptHandler()
5505 DAC960_Controller_T *Controller = DeviceIdentifier; in DAC960_P_InterruptHandler() local
5506 void __iomem *ControllerBaseAddress = Controller->BaseAddress; in DAC960_P_InterruptHandler()
5509 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_P_InterruptHandler()
5514 DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; in DAC960_P_InterruptHandler()
5526 DAC960_P_To_PD_TranslateEnquiry(Controller->V1.NewEnquiry); in DAC960_P_InterruptHandler()
5531 DAC960_P_To_PD_TranslateDeviceState(Controller->V1.NewDeviceState); in DAC960_P_InterruptHandler()
5560 DAC960_ProcessRequest(Controller); in DAC960_P_InterruptHandler()
5561 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_P_InterruptHandler()
5573 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V1_QueueMonitoringCommand() local
5578 CommandMailbox->Type3.BusAddress = Controller->V1.NewEnquiryDMA; in DAC960_V1_QueueMonitoringCommand()
5590 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V2_QueueMonitoringCommand() local
5606 Controller->V2.NewControllerInformationDMA; in DAC960_V2_QueueMonitoringCommand()
5622 DAC960_Controller_T *Controller = (DAC960_Controller_T *) TimerData; in DAC960_MonitoringTimerFunction() local
5626 if (Controller->FirmwareType == DAC960_V1_Controller) in DAC960_MonitoringTimerFunction()
5628 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_MonitoringTimerFunction()
5632 Command = DAC960_AllocateCommand(Controller); in DAC960_MonitoringTimerFunction()
5635 else Controller->MonitoringCommandDeferred = true; in DAC960_MonitoringTimerFunction()
5636 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_MonitoringTimerFunction()
5641 &Controller->V2.ControllerInformation; in DAC960_MonitoringTimerFunction()
5643 Controller->V2.HealthStatusBuffer->StatusChangeCounter; in DAC960_MonitoringTimerFunction()
5645 if (time_after(jiffies, Controller->SecondaryMonitoringTime in DAC960_MonitoringTimerFunction()
5654 Controller->V2.LogicalDeviceInformation[LogicalDriveNumber]; in DAC960_MonitoringTimerFunction()
5663 Controller->SecondaryMonitoringTime = jiffies; in DAC960_MonitoringTimerFunction()
5665 if (StatusChangeCounter == Controller->V2.StatusChangeCounter && in DAC960_MonitoringTimerFunction()
5666 Controller->V2.HealthStatusBuffer->NextEventSequenceNumber in DAC960_MonitoringTimerFunction()
5667 == Controller->V2.NextEventSequenceNumber && in DAC960_MonitoringTimerFunction()
5674 time_before(jiffies, Controller->PrimaryMonitoringTime in DAC960_MonitoringTimerFunction()
5678 Controller->MonitoringTimer.expires = in DAC960_MonitoringTimerFunction()
5680 add_timer(&Controller->MonitoringTimer); in DAC960_MonitoringTimerFunction()
5683 Controller->V2.StatusChangeCounter = StatusChangeCounter; in DAC960_MonitoringTimerFunction()
5684 Controller->PrimaryMonitoringTime = jiffies; in DAC960_MonitoringTimerFunction()
5686 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_MonitoringTimerFunction()
5690 Command = DAC960_AllocateCommand(Controller); in DAC960_MonitoringTimerFunction()
5693 else Controller->MonitoringCommandDeferred = true; in DAC960_MonitoringTimerFunction()
5694 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_MonitoringTimerFunction()
5698 wake_up(&Controller->HealthStatusWaitQueue); in DAC960_MonitoringTimerFunction()
5708 static bool DAC960_CheckStatusBuffer(DAC960_Controller_T *Controller, in DAC960_CheckStatusBuffer() argument
5712 if (Controller->InitialStatusLength + 1 + in DAC960_CheckStatusBuffer()
5713 Controller->CurrentStatusLength + ByteCount + 1 <= in DAC960_CheckStatusBuffer()
5714 Controller->CombinedStatusBufferLength) in DAC960_CheckStatusBuffer()
5716 if (Controller->CombinedStatusBufferLength == 0) in DAC960_CheckStatusBuffer()
5721 Controller->CombinedStatusBuffer = kmalloc(NewStatusBufferLength, in DAC960_CheckStatusBuffer()
5723 if (Controller->CombinedStatusBuffer == NULL) return false; in DAC960_CheckStatusBuffer()
5724 Controller->CombinedStatusBufferLength = NewStatusBufferLength; in DAC960_CheckStatusBuffer()
5727 NewStatusBuffer = kmalloc(2 * Controller->CombinedStatusBufferLength, in DAC960_CheckStatusBuffer()
5732 Controller); in DAC960_CheckStatusBuffer()
5735 memcpy(NewStatusBuffer, Controller->CombinedStatusBuffer, in DAC960_CheckStatusBuffer()
5736 Controller->CombinedStatusBufferLength); in DAC960_CheckStatusBuffer()
5737 kfree(Controller->CombinedStatusBuffer); in DAC960_CheckStatusBuffer()
5738 Controller->CombinedStatusBuffer = NewStatusBuffer; in DAC960_CheckStatusBuffer()
5739 Controller->CombinedStatusBufferLength *= 2; in DAC960_CheckStatusBuffer()
5740 Controller->CurrentStatusBuffer = in DAC960_CheckStatusBuffer()
5741 &NewStatusBuffer[Controller->InitialStatusLength + 1]; in DAC960_CheckStatusBuffer()
5752 DAC960_Controller_T *Controller, in DAC960_Message() argument
5759 va_start(Arguments, Controller); in DAC960_Message()
5762 if (Controller == NULL) in DAC960_Message()
5768 if (!Controller->ControllerInitialized) in DAC960_Message()
5770 if (DAC960_CheckStatusBuffer(Controller, Length)) in DAC960_Message()
5772 strcpy(&Controller->CombinedStatusBuffer in DAC960_Message()
5773 [Controller->InitialStatusLength], in DAC960_Message()
5775 Controller->InitialStatusLength += Length; in DAC960_Message()
5776 Controller->CurrentStatusBuffer = in DAC960_Message()
5777 &Controller->CombinedStatusBuffer in DAC960_Message()
5778 [Controller->InitialStatusLength + 1]; in DAC960_Message()
5794 Controller->ControllerNumber, Buffer); in DAC960_Message()
5799 else if (DAC960_CheckStatusBuffer(Controller, Length)) in DAC960_Message()
5801 strcpy(&Controller->CurrentStatusBuffer[ in DAC960_Message()
5802 Controller->CurrentStatusLength], Buffer); in DAC960_Message()
5803 Controller->CurrentStatusLength += Length; in DAC960_Message()
5808 strcpy(Controller->ProgressBuffer, Buffer); in DAC960_Message()
5809 Controller->ProgressBufferLength = Length; in DAC960_Message()
5810 if (Controller->EphemeralProgressMessage) in DAC960_Message()
5812 if (time_after_eq(jiffies, Controller->LastProgressReportTime in DAC960_Message()
5816 Controller->ControllerNumber, Buffer); in DAC960_Message()
5817 Controller->LastProgressReportTime = jiffies; in DAC960_Message()
5821 Controller->ControllerNumber, Buffer); in DAC960_Message()
5825 strcpy(&Controller->UserStatusBuffer[Controller->UserStatusLength], in DAC960_Message()
5827 Controller->UserStatusLength += Length; in DAC960_Message()
5830 Controller->ControllerNumber, Buffer); in DAC960_Message()
5836 Controller->ControllerNumber, Buffer); in DAC960_Message()
5849 static bool DAC960_ParsePhysicalDevice(DAC960_Controller_T *Controller, in DAC960_ParsePhysicalDevice() argument
5862 XChannel >= Controller->Channels) in DAC960_ParsePhysicalDevice()
5868 XTargetID >= Controller->Targets) in DAC960_ParsePhysicalDevice()
5882 static bool DAC960_ParseLogicalDrive(DAC960_Controller_T *Controller, in DAC960_ParseLogicalDrive() argument
5907 static void DAC960_V1_SetDeviceState(DAC960_Controller_T *Controller, in DAC960_V1_SetDeviceState() argument
5925 DAC960_UserCritical("%s of Physical Device %d:%d Succeeded\n", Controller, in DAC960_V1_SetDeviceState()
5930 "Unable to Start Device\n", Controller, in DAC960_V1_SetDeviceState()
5935 "No Device at Address\n", Controller, in DAC960_V1_SetDeviceState()
5941 Controller, DeviceStateString, Channel, TargetID); in DAC960_V1_SetDeviceState()
5945 "Channel Busy\n", Controller, in DAC960_V1_SetDeviceState()
5950 "Unexpected Status %04X\n", Controller, in DAC960_V1_SetDeviceState()
5963 static bool DAC960_V1_ExecuteUserCommand(DAC960_Controller_T *Controller, in DAC960_V1_ExecuteUserCommand() argument
5971 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V1_ExecuteUserCommand()
5972 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_V1_ExecuteUserCommand()
5973 DAC960_WaitForCommand(Controller); in DAC960_V1_ExecuteUserCommand()
5974 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V1_ExecuteUserCommand()
5975 Controller->UserStatusLength = 0; in DAC960_V1_ExecuteUserCommand()
5983 DAC960_UserCritical("Cache Flush Completed\n", Controller); in DAC960_V1_ExecuteUserCommand()
5986 DAC960_ParsePhysicalDevice(Controller, &UserCommand[4], in DAC960_V1_ExecuteUserCommand()
5990 &Controller->V1.DeviceState[Channel][TargetID]; in DAC960_V1_ExecuteUserCommand()
5994 DAC960_V1_SetDeviceState(Controller, Command, Channel, TargetID, in DAC960_V1_ExecuteUserCommand()
5997 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6000 DAC960_ParsePhysicalDevice(Controller, &UserCommand[11], in DAC960_V1_ExecuteUserCommand()
6004 &Controller->V1.DeviceState[Channel][TargetID]; in DAC960_V1_ExecuteUserCommand()
6008 DAC960_V1_SetDeviceState(Controller, Command, Channel, TargetID, in DAC960_V1_ExecuteUserCommand()
6011 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6015 DAC960_ParsePhysicalDevice(Controller, &UserCommand[12], in DAC960_V1_ExecuteUserCommand()
6019 &Controller->V1.DeviceState[Channel][TargetID]; in DAC960_V1_ExecuteUserCommand()
6023 DAC960_V1_SetDeviceState(Controller, Command, Channel, TargetID, in DAC960_V1_ExecuteUserCommand()
6027 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6030 DAC960_ParsePhysicalDevice(Controller, &UserCommand[7], in DAC960_V1_ExecuteUserCommand()
6041 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6047 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6052 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6057 Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6062 "in Progress\n", Controller, Channel, TargetID); in DAC960_V1_ExecuteUserCommand()
6066 "Unexpected Status %04X\n", Controller, in DAC960_V1_ExecuteUserCommand()
6072 DAC960_ParseLogicalDrive(Controller, &UserCommand[17], in DAC960_V1_ExecuteUserCommand()
6084 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6085 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6092 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6093 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6100 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6101 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6108 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6109 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6116 Controller, LogicalDriveNumber, in DAC960_V1_ExecuteUserCommand()
6117 Controller->ControllerNumber, in DAC960_V1_ExecuteUserCommand()
6132 OldRebuildRateConstant = pci_alloc_consistent( Controller->PCIDevice, in DAC960_V1_ExecuteUserCommand()
6138 Controller); in DAC960_V1_ExecuteUserCommand()
6149 Controller); in DAC960_V1_ExecuteUserCommand()
6155 Controller, Command->V1.CommandStatus); in DAC960_V1_ExecuteUserCommand()
6159 pci_free_consistent(Controller->PCIDevice, sizeof(char), in DAC960_V1_ExecuteUserCommand()
6163 Controller, UserCommand); in DAC960_V1_ExecuteUserCommand()
6165 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V1_ExecuteUserCommand()
6167 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V1_ExecuteUserCommand()
6185 DAC960_Controller_T *Controller = Command->Controller; in DAC960_V2_TranslatePhysicalDevice() local
6205 Controller->V2.PhysicalToLogicalDeviceDMA; in DAC960_V2_TranslatePhysicalDevice()
6212 *LogicalDeviceNumber = Controller->V2.PhysicalToLogicalDevice->LogicalDeviceNumber; in DAC960_V2_TranslatePhysicalDevice()
6225 static bool DAC960_V2_ExecuteUserCommand(DAC960_Controller_T *Controller, in DAC960_V2_ExecuteUserCommand() argument
6234 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V2_ExecuteUserCommand()
6235 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_V2_ExecuteUserCommand()
6236 DAC960_WaitForCommand(Controller); in DAC960_V2_ExecuteUserCommand()
6237 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V2_ExecuteUserCommand()
6238 Controller->UserStatusLength = 0; in DAC960_V2_ExecuteUserCommand()
6251 DAC960_UserCritical("Cache Flush Completed\n", Controller); in DAC960_V2_ExecuteUserCommand()
6254 DAC960_ParsePhysicalDevice(Controller, &UserCommand[4], in DAC960_V2_ExecuteUserCommand()
6267 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6273 DAC960_ParsePhysicalDevice(Controller, &UserCommand[11], in DAC960_V2_ExecuteUserCommand()
6286 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6292 DAC960_ParsePhysicalDevice(Controller, &UserCommand[12], in DAC960_V2_ExecuteUserCommand()
6305 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6311 DAC960_ParsePhysicalDevice(Controller, &UserCommand[7], in DAC960_V2_ExecuteUserCommand()
6322 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6328 DAC960_ParsePhysicalDevice(Controller, &UserCommand[14], in DAC960_V2_ExecuteUserCommand()
6339 Controller, Channel, TargetID, in DAC960_V2_ExecuteUserCommand()
6345 DAC960_ParseLogicalDrive(Controller, &UserCommand[17], in DAC960_V2_ExecuteUserCommand()
6357 Controller, LogicalDriveNumber, in DAC960_V2_ExecuteUserCommand()
6358 Controller->ControllerNumber, in DAC960_V2_ExecuteUserCommand()
6365 DAC960_ParseLogicalDrive(Controller, &UserCommand[24], in DAC960_V2_ExecuteUserCommand()
6375 Controller, LogicalDriveNumber, in DAC960_V2_ExecuteUserCommand()
6376 Controller->ControllerNumber, in DAC960_V2_ExecuteUserCommand()
6386 DAC960_UserCritical("Discovery %s\n", Controller, in DAC960_V2_ExecuteUserCommand()
6409 Controller->V2.NewControllerInformationDMA; in DAC960_V2_ExecuteUserCommand()
6416 if (!Controller->V2.NewControllerInformation->PhysicalScanActive) in DAC960_V2_ExecuteUserCommand()
6420 DAC960_UserCritical("Discovery Completed\n", Controller); in DAC960_V2_ExecuteUserCommand()
6424 Controller->SuppressEnclosureMessages = true; in DAC960_V2_ExecuteUserCommand()
6426 Controller, UserCommand); in DAC960_V2_ExecuteUserCommand()
6428 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_V2_ExecuteUserCommand()
6430 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_V2_ExecuteUserCommand()
6442 DAC960_Controller_T *Controller = DAC960_Controllers[ControllerNumber]; in dac960_proc_show() local
6443 if (Controller == NULL) continue; in dac960_proc_show()
6444 if (Controller->MonitoringAlertMode) in dac960_proc_show()
6469 DAC960_Controller_T *Controller = (DAC960_Controller_T *)m->private; in dac960_initial_status_proc_show() local
6470 seq_printf(m, "%.*s", Controller->InitialStatusLength, Controller->CombinedStatusBuffer); in dac960_initial_status_proc_show()
6489 DAC960_Controller_T *Controller = (DAC960_Controller_T *) m->private; in dac960_current_status_proc_show() local
6493 if (jiffies != Controller->LastCurrentStatusTime) in dac960_current_status_proc_show()
6495 Controller->CurrentStatusLength = 0; in dac960_current_status_proc_show()
6496 DAC960_AnnounceDriver(Controller); in dac960_current_status_proc_show()
6497 DAC960_ReportControllerConfiguration(Controller); in dac960_current_status_proc_show()
6498 DAC960_ReportDeviceConfiguration(Controller); in dac960_current_status_proc_show()
6499 if (Controller->ProgressBufferLength > 0) in dac960_current_status_proc_show()
6500 ProgressMessageLength = Controller->ProgressBufferLength; in dac960_current_status_proc_show()
6501 if (DAC960_CheckStatusBuffer(Controller, 2 + ProgressMessageLength)) in dac960_current_status_proc_show()
6503 unsigned char *CurrentStatusBuffer = Controller->CurrentStatusBuffer; in dac960_current_status_proc_show()
6504 CurrentStatusBuffer[Controller->CurrentStatusLength++] = ' '; in dac960_current_status_proc_show()
6505 CurrentStatusBuffer[Controller->CurrentStatusLength++] = ' '; in dac960_current_status_proc_show()
6506 if (Controller->ProgressBufferLength > 0) in dac960_current_status_proc_show()
6507 strcpy(&CurrentStatusBuffer[Controller->CurrentStatusLength], in dac960_current_status_proc_show()
6508 Controller->ProgressBuffer); in dac960_current_status_proc_show()
6510 strcpy(&CurrentStatusBuffer[Controller->CurrentStatusLength], in dac960_current_status_proc_show()
6512 Controller->CurrentStatusLength += ProgressMessageLength; in dac960_current_status_proc_show()
6514 Controller->LastCurrentStatusTime = jiffies; in dac960_current_status_proc_show()
6516 seq_printf(m, "%.*s", Controller->CurrentStatusLength, Controller->CurrentStatusBuffer); in dac960_current_status_proc_show()
6535 DAC960_Controller_T *Controller = (DAC960_Controller_T *)m->private; in dac960_user_command_proc_show() local
6537 seq_printf(m, "%.*s", Controller->UserStatusLength, Controller->UserStatusBuffer); in dac960_user_command_proc_show()
6550 DAC960_Controller_T *Controller = PDE_DATA(file_inode(file)); in dac960_user_command_proc_write() local
6559 if (Controller->FirmwareType == DAC960_V1_Controller) in dac960_user_command_proc_write()
6560 return (DAC960_V1_ExecuteUserCommand(Controller, CommandBuffer) in dac960_user_command_proc_write()
6563 return (DAC960_V2_ExecuteUserCommand(Controller, CommandBuffer) in dac960_user_command_proc_write()
6581 static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller) in DAC960_CreateProcEntries() argument
6591 sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber); in DAC960_CreateProcEntries()
6592 ControllerProcEntry = proc_mkdir(Controller->ControllerName, in DAC960_CreateProcEntries()
6594 …reate_data("initial_status", 0, ControllerProcEntry, &dac960_initial_status_proc_fops, Controller); in DAC960_CreateProcEntries()
6595 …reate_data("current_status", 0, ControllerProcEntry, &dac960_current_status_proc_fops, Controller); in DAC960_CreateProcEntries()
6596 …user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller); in DAC960_CreateProcEntries()
6597 Controller->ControllerProcEntry = ControllerProcEntry; in DAC960_CreateProcEntries()
6606 static void DAC960_DestroyProcEntries(DAC960_Controller_T *Controller) in DAC960_DestroyProcEntries() argument
6608 if (Controller->ControllerProcEntry == NULL) in DAC960_DestroyProcEntries()
6610 remove_proc_entry("initial_status", Controller->ControllerProcEntry); in DAC960_DestroyProcEntries()
6611 remove_proc_entry("current_status", Controller->ControllerProcEntry); in DAC960_DestroyProcEntries()
6612 remove_proc_entry("user_command", Controller->ControllerProcEntry); in DAC960_DestroyProcEntries()
6613 remove_proc_entry(Controller->ControllerName, DAC960_ProcDirectoryEntry); in DAC960_DestroyProcEntries()
6614 Controller->ControllerProcEntry = NULL; in DAC960_DestroyProcEntries()
6640 DAC960_Controller_T *Controller; in DAC960_gam_ioctl() local
6653 Controller = DAC960_Controllers[ControllerNumber]; in DAC960_gam_ioctl()
6654 if (Controller == NULL) in DAC960_gam_ioctl()
6658 ControllerInfo.FirmwareType = Controller->FirmwareType; in DAC960_gam_ioctl()
6659 ControllerInfo.Channels = Controller->Channels; in DAC960_gam_ioctl()
6660 ControllerInfo.Targets = Controller->Targets; in DAC960_gam_ioctl()
6661 ControllerInfo.PCI_Bus = Controller->Bus; in DAC960_gam_ioctl()
6662 ControllerInfo.PCI_Device = Controller->Device; in DAC960_gam_ioctl()
6663 ControllerInfo.PCI_Function = Controller->Function; in DAC960_gam_ioctl()
6664 ControllerInfo.IRQ_Channel = Controller->IRQ_Channel; in DAC960_gam_ioctl()
6665 ControllerInfo.PCI_Address = Controller->PCI_Address; in DAC960_gam_ioctl()
6666 strcpy(ControllerInfo.ModelName, Controller->ModelName); in DAC960_gam_ioctl()
6667 strcpy(ControllerInfo.FirmwareVersion, Controller->FirmwareVersion); in DAC960_gam_ioctl()
6677 DAC960_Controller_T *Controller; in DAC960_gam_ioctl() local
6702 Controller = DAC960_Controllers[ControllerNumber]; in DAC960_gam_ioctl()
6703 if (Controller == NULL) in DAC960_gam_ioctl()
6706 if (Controller->FirmwareType != DAC960_V1_Controller) in DAC960_gam_ioctl()
6734 DCDB_IOBUF = pci_alloc_consistent(Controller->PCIDevice, in DAC960_gam_ioctl()
6744 DataTransferBuffer = pci_zalloc_consistent(Controller->PCIDevice, in DAC960_gam_ioctl()
6752 DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, in DAC960_gam_ioctl()
6765 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6766 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_gam_ioctl()
6767 DAC960_WaitForCommand(Controller); in DAC960_gam_ioctl()
6768 while (Controller->V1.DirectCommandActive[DCDB.Channel] in DAC960_gam_ioctl()
6771 spin_unlock_irq(&Controller->queue_lock); in DAC960_gam_ioctl()
6772 __wait_event(Controller->CommandWaitQueue, in DAC960_gam_ioctl()
6773 !Controller->V1.DirectCommandActive in DAC960_gam_ioctl()
6775 spin_lock_irq(&Controller->queue_lock); in DAC960_gam_ioctl()
6777 Controller->V1.DirectCommandActive[DCDB.Channel] in DAC960_gam_ioctl()
6779 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6790 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6791 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_gam_ioctl()
6792 DAC960_WaitForCommand(Controller); in DAC960_gam_ioctl()
6793 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6804 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6806 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6821 Controller->V1.DirectCommandActive[DCDB.Channel] in DAC960_gam_ioctl()
6832 pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength), in DAC960_gam_ioctl()
6835 pci_free_consistent(Controller->PCIDevice, sizeof(DAC960_V1_DCDB_T), in DAC960_gam_ioctl()
6844 DAC960_Controller_T *Controller; in DAC960_gam_ioctl() local
6869 Controller = DAC960_Controllers[ControllerNumber]; in DAC960_gam_ioctl()
6870 if (Controller == NULL) in DAC960_gam_ioctl()
6872 if (Controller->FirmwareType != DAC960_V2_Controller){ in DAC960_gam_ioctl()
6880 DataTransferBuffer = pci_zalloc_consistent(Controller->PCIDevice, in DAC960_gam_ioctl()
6888 DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice, in DAC960_gam_ioctl()
6902 RequestSenseBuffer = pci_zalloc_consistent(Controller->PCIDevice, in DAC960_gam_ioctl()
6911 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6912 while ((Command = DAC960_AllocateCommand(Controller)) == NULL) in DAC960_gam_ioctl()
6913 DAC960_WaitForCommand(Controller); in DAC960_gam_ioctl()
6914 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6962 spin_lock_irqsave(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6964 spin_unlock_irqrestore(&Controller->queue_lock, flags); in DAC960_gam_ioctl()
6996 pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength), in DAC960_gam_ioctl()
6999 pci_free_consistent(Controller->PCIDevice, RequestSenseLength, in DAC960_gam_ioctl()
7009 DAC960_Controller_T *Controller; in DAC960_gam_ioctl() local
7025 Controller = DAC960_Controllers[ControllerNumber]; in DAC960_gam_ioctl()
7026 if (Controller == NULL) in DAC960_gam_ioctl()
7028 if (Controller->FirmwareType != DAC960_V2_Controller) { in DAC960_gam_ioctl()
7038 ErrorCode = wait_event_interruptible_timeout(Controller->HealthStatusWaitQueue, in DAC960_gam_ioctl()
7039 !(Controller->V2.HealthStatusBuffer->StatusChangeCounter in DAC960_gam_ioctl()
7041 Controller->V2.HealthStatusBuffer->NextEventSequenceNumber in DAC960_gam_ioctl()
7049 Controller->V2.HealthStatusBuffer, in DAC960_gam_ioctl()
7225 DAC960_Controller_T *Controller = DAC960_Controllers[i]; in DAC960_cleanup_module() local
7226 if (Controller == NULL) in DAC960_cleanup_module()
7228 DAC960_FinalizeController(Controller); in DAC960_cleanup_module()