26 #define DAC960_MaxControllers 8
34 #define DAC960_V1_MaxChannels 3
35 #define DAC960_V2_MaxChannels 4
43 #define DAC960_V1_MaxTargets 16
44 #define DAC960_V2_MaxTargets 128
52 #define DAC960_MaxLogicalDrives 32
60 #define DAC960_V1_MaxPhysicalDevices 45
61 #define DAC960_V2_MaxPhysicalDevices 272
194 DAC960_SCSI_RequestSenseKey_T;
206 DAC960_SCSI_RequestSenseKey_T SenseKey:4;
299 DAC960_V1_CommandOpcode_T;
313 #define DAC960_V1_NormalCompletion 0x0000
314 #define DAC960_V1_CheckConditionReceived 0x0002
315 #define DAC960_V1_NoDeviceAtAddress 0x0102
316 #define DAC960_V1_InvalidDeviceAddress 0x0105
317 #define DAC960_V1_InvalidParameter 0x0105
318 #define DAC960_V1_IrrecoverableDataError 0x0001
319 #define DAC960_V1_LogicalDriveNonexistentOrOffline 0x0002
320 #define DAC960_V1_AccessBeyondEndOfLogicalDrive 0x0105
321 #define DAC960_V1_BadDataEncountered 0x010C
322 #define DAC960_V1_DeviceBusy 0x0008
323 #define DAC960_V1_DeviceNonresponsive 0x000E
324 #define DAC960_V1_CommandTerminatedAbnormally 0x000F
325 #define DAC960_V1_UnableToStartDevice 0x0002
326 #define DAC960_V1_InvalidChannelOrTargetOrModifier 0x0105
327 #define DAC960_V1_ChannelBusy 0x0106
328 #define DAC960_V1_ChannelNotStopped 0x0002
329 #define DAC960_V1_AttemptToRebuildOnlineDrive 0x0002
330 #define DAC960_V1_RebuildBadBlocksEncountered 0x0003
331 #define DAC960_V1_NewDiskFailedDuringRebuild 0x0004
332 #define DAC960_V1_RebuildOrCheckAlreadyInProgress 0x0106
333 #define DAC960_V1_DependentDiskIsDead 0x0002
334 #define DAC960_V1_InconsistentBlocksFound 0x0003
335 #define DAC960_V1_InvalidOrNonredundantLogicalDrive 0x0105
336 #define DAC960_V1_NoRebuildOrCheckInProgress 0x0105
337 #define DAC960_V1_RebuildInProgress_DataValid 0x0000
338 #define DAC960_V1_RebuildFailed_LogicalDriveFailure 0x0002
339 #define DAC960_V1_RebuildFailed_BadBlocksOnOther 0x0003
340 #define DAC960_V1_RebuildFailed_NewDriveFailed 0x0004
341 #define DAC960_V1_RebuildSuccessful 0x0100
342 #define DAC960_V1_RebuildSuccessfullyTerminated 0x0107
343 #define DAC960_V1_BackgroundInitSuccessful 0x0100
344 #define DAC960_V1_BackgroundInitAborted 0x0005
345 #define DAC960_V1_NoBackgroundInitInProgress 0x0105
346 #define DAC960_V1_AddCapacityInProgress 0x0004
347 #define DAC960_V1_AddCapacityFailedOrSuspended 0x00F4
348 #define DAC960_V1_Config2ChecksumError 0x0002
349 #define DAC960_V1_ConfigurationSuspended 0x0106
350 #define DAC960_V1_FailedToConfigureNVRAM 0x0105
351 #define DAC960_V1_ConfigurationNotSavedStateChange 0x0106
352 #define DAC960_V1_SubsystemNotInstalled 0x0001
353 #define DAC960_V1_SubsystemFailed 0x0002
354 #define DAC960_V1_SubsystemBusy 0x0106
432 unsigned char ActualChannels;
450 unsigned char TurnID;
456 unsigned char ActualChannels;
470 DAC960_V1_RamType_DRAM = 0x0,
471 DAC960_V1_RamType_EDO = 0x1,
472 DAC960_V1_RamType_SDRAM = 0x2,
473 DAC960_V1_RamType_Last = 0x7
476 DAC960_V1_ErrorCorrection_None = 0x0,
477 DAC960_V1_ErrorCorrection_Parity = 0x1,
478 DAC960_V1_ErrorCorrection_ECC = 0x2,
479 DAC960_V1_ErrorCorrection_Last = 0x7
482 bool LowPowerMemory:1;
486 unsigned short MemorySpeed;
487 unsigned short HardwareSpeed;
494 unsigned short MaxScatterGatherEntries;
495 unsigned short MaxDriveCommands;
496 unsigned short MaxIODescriptors;
497 unsigned short MaxCombinedSectors;
498 unsigned char Latency;
500 unsigned char SCSITimeout;
502 unsigned short MinFreeLines;
511 unsigned short PhysicalDriveBlockSize;
512 unsigned short LogicalDriveBlockSize;
513 unsigned short MaxBlocksPerCommand;
514 unsigned short BlockFactor;
515 unsigned short CacheLineSize;
518 DAC960_V1_Narrow_8bit = 0x0,
519 DAC960_V1_Wide_16bit = 0x1,
520 DAC960_V1_Wide_32bit = 0x2
523 DAC960_V1_Fast = 0x0,
524 DAC960_V1_Ultra = 0x1,
525 DAC960_V1_Ultra2 = 0x2
532 unsigned short FirmwareBuildNumber;
544 bool MylexOnlineRAIDExpansion:1;
546 bool BackgroundInitialization:1;
566 DAC960_V1_LogicalDriveState_T;
577 unsigned char RAIDLevel:7;
602 DAC960_V1_PerformEventLogOpType_T;
621 DAC960_SCSI_RequestSenseKey_T SenseKey:4;
648 DAC960_V1_PhysicalDeviceState_T;
672 bool TaggedQueuingSupported:1;
675 unsigned char SynchronousMultiplier;
676 unsigned char SynchronousOffset:5;
754 bool ActiveNegationEnabled:1;
756 bool NoRescanIfResetReceivedDuringScan:1;
757 bool StorageWorksSupportEnabled:1;
758 bool HewlettPackardSupportEnabled:1;
759 bool NoDisconnectOnFirstCommand:1;
772 unsigned char OEMModelNumber;
773 unsigned char PhysicalSector;
774 unsigned char LogicalSector;
775 unsigned char BlockFactor;
776 bool ReadAheadEnabled:1;
779 bool ReassignRestrictedToOneSector:1;
781 bool ForceUnitAccessDuringWriteRecovery:1;
782 bool EnableLeftSymmetricRAID5Algorithm:1;
783 unsigned char DefaultRebuildRate;
785 unsigned char BlocksPerCacheLine;
786 unsigned char BlocksPerStripe;
795 bool DisableFast20:1;
797 bool EnableTaggedQueuing:1;
799 unsigned char SCSIInitiatorID;
805 unsigned char SimultaneousDeviceSpinUpCount;
806 unsigned char SecondsDelayBetweenSpinUps;
809 bool CDROMBootEnabled:1;
812 DAC960_V1_Geometry_128_32 = 0x0,
813 DAC960_V1_Geometry_255_63 = 0x1,
814 DAC960_V1_Geometry_Reserved1 = 0x2,
815 DAC960_V1_Geometry_Reserved2 = 0x3
833 DAC960_V1_DCDB_NoDataTransfer = 0,
834 DAC960_V1_DCDB_DataTransferDeviceToSystem = 1,
835 DAC960_V1_DCDB_DataTransferSystemToDevice = 2,
836 DAC960_V1_DCDB_IllegalDataTransfer = 3
841 DAC960_V1_DCDB_Timeout_24_hours = 0,
842 DAC960_V1_DCDB_Timeout_10_seconds = 1,
843 DAC960_V1_DCDB_Timeout_60_seconds = 2,
844 DAC960_V1_DCDB_Timeout_10_minutes = 3
846 bool NoAutomaticRequestSense:1;
847 bool DisconnectPermitted:1;
850 unsigned char CDBLength:4;
851 unsigned char TransferLengthHigh4:4;
852 unsigned char SenseLength;
853 unsigned char CDB[12];
854 unsigned char SenseData[64];
882 unsigned int Words[4];
883 unsigned char Bytes[16];
949 unsigned char Dummy[3];
967 unsigned char Dummy[3];
976 unsigned char Dummy[4];
996 DAC960_V2_CommandOpcode_T;
1021 DAC960_V2_IOCTL_Opcode_T;
1035 #define DAC960_V2_NormalCompletion 0x00
1036 #define DAC960_V2_AbormalCompletion 0x02
1037 #define DAC960_V2_DeviceBusy 0x08
1038 #define DAC960_V2_DeviceNonresponsive 0x0E
1039 #define DAC960_V2_DeviceNonresponsive2 0x0F
1040 #define DAC960_V2_DeviceRevervationConflict 0x18
1052 DAC960_V2_MemoryType_Reserved = 0x00,
1053 DAC960_V2_MemoryType_DRAM = 0x01,
1054 DAC960_V2_MemoryType_EDRAM = 0x02,
1055 DAC960_V2_MemoryType_EDO = 0x03,
1056 DAC960_V2_MemoryType_SDRAM = 0x04,
1057 DAC960_V2_MemoryType_Last = 0x1F
1060 bool MemoryParity:1;
1081 DAC960_V2_ProcessorType_T;
1130 unsigned short BusInterfaceSpeedMHz;
1131 unsigned char BusWidthBits;
1132 unsigned char FlashCodeTypeOrProductID;
1133 unsigned char NumberOfHostPortsPresent;
1135 unsigned char BusInterfaceName[16];
1136 unsigned char ControllerName[16];
1137 unsigned char Reserved2[16];
1139 unsigned char FirmwareMajorVersion;
1140 unsigned char FirmwareMinorVersion;
1141 unsigned char FirmwareTurnNumber;
1142 unsigned char FirmwareBuildNumber;
1143 unsigned char FirmwareReleaseDay;
1144 unsigned char FirmwareReleaseMonth;
1145 unsigned char FirmwareReleaseYearHigh2Digits;
1146 unsigned char FirmwareReleaseYearLow2Digits;
1148 unsigned char HardwareRevision;
1150 unsigned char HardwareReleaseDay;
1151 unsigned char HardwareReleaseMonth;
1152 unsigned char HardwareReleaseYearHigh2Digits;
1153 unsigned char HardwareReleaseYearLow2Digits;
1155 unsigned char ManufacturingBatchNumber;
1157 unsigned char ManufacturingPlantNumber;
1159 unsigned char HardwareManufacturingDay;
1160 unsigned char HardwareManufacturingMonth;
1161 unsigned char HardwareManufacturingYearHigh2Digits;
1162 unsigned char HardwareManufacturingYearLow2Digits;
1163 unsigned char MaximumNumberOfPDDperXLD;
1164 unsigned char MaximumNumberOfILDperXLD;
1165 unsigned short NonvolatileMemorySizeKB;
1166 unsigned char MaximumNumberOfXLD;
1169 unsigned char ControllerSerialNumber[16];
1173 unsigned char OEM_Code;
1174 unsigned char VendorName[16];
1177 bool ActiveActiveClusteringMode:1;
1182 bool PhysicalScanActive:1;
1184 unsigned char PhysicalDeviceChannelNumber;
1185 unsigned char PhysicalDeviceTargetID;
1186 unsigned char PhysicalDeviceLogicalUnit;
1188 unsigned short MaximumDataTransferSizeInBlocks;
1189 unsigned short MaximumScatterGatherEntries;
1191 unsigned short LogicalDevicesPresent;
1192 unsigned short LogicalDevicesCritical;
1193 unsigned short LogicalDevicesOffline;
1194 unsigned short PhysicalDevicesPresent;
1195 unsigned short PhysicalDisksPresent;
1196 unsigned short PhysicalDisksCritical;
1197 unsigned short PhysicalDisksOffline;
1198 unsigned short MaximumParallelCommands;
1200 unsigned char NumberOfPhysicalChannelsPresent;
1201 unsigned char NumberOfVirtualChannelsPresent;
1202 unsigned char NumberOfPhysicalChannelsPossible;
1203 unsigned char NumberOfVirtualChannelsPossible;
1204 unsigned char MaximumTargetsPerChannel[16];
1207 unsigned short MemorySizeMB;
1208 unsigned short CacheSizeMB;
1209 unsigned int ValidCacheSizeInBytes;
1210 unsigned int DirtyCacheSizeInBytes;
1211 unsigned short MemorySpeedMHz;
1212 unsigned char MemoryDataWidthBits;
1214 unsigned char CacheMemoryTypeName[16];
1216 unsigned short ExecutionMemorySizeMB;
1217 unsigned short ExecutionL2CacheSizeMB;
1219 unsigned short ExecutionMemorySpeedMHz;
1220 unsigned char ExecutionMemoryDataWidthBits;
1222 unsigned char ExecutionMemoryTypeName[16];
1224 unsigned short FirstProcessorSpeedMHz;
1225 DAC960_V2_ProcessorType_T FirstProcessorType;
1226 unsigned char FirstProcessorCount;
1227 unsigned char Reserved6[12];
1228 unsigned char FirstProcessorName[16];
1230 unsigned short SecondProcessorSpeedMHz;
1231 DAC960_V2_ProcessorType_T SecondProcessorType;
1232 unsigned char SecondProcessorCount;
1234 unsigned char SecondProcessorName[16];
1236 unsigned short CurrentProfilingDataPageNumber;
1237 unsigned short ProgramsAwaitingProfilingData;
1238 unsigned short CurrentCommandTimeTraceDataPageNumber;
1239 unsigned short ProgramsAwaitingCommandTimeTraceData;
1240 unsigned char Reserved8[8];
1242 unsigned short PhysicalDeviceBusResets;
1243 unsigned short PhysicalDeviceParityErrors;
1244 unsigned short PhysicalDeviceSoftErrors;
1245 unsigned short PhysicalDeviceCommandsFailed;
1246 unsigned short PhysicalDeviceMiscellaneousErrors;
1247 unsigned short PhysicalDeviceCommandTimeouts;
1248 unsigned short PhysicalDeviceSelectionTimeouts;
1249 unsigned short PhysicalDeviceRetriesDone;
1250 unsigned short PhysicalDeviceAbortsDone;
1251 unsigned short PhysicalDeviceHostCommandAbortsDone;
1252 unsigned short PhysicalDevicePredictedFailuresDetected;
1253 unsigned short PhysicalDeviceHostCommandsFailed;
1254 unsigned short PhysicalDeviceHardErrors;
1255 unsigned char Reserved9[6];
1257 unsigned short LogicalDeviceSoftErrors;
1258 unsigned short LogicalDeviceCommandsFailed;
1259 unsigned short LogicalDeviceHostCommandAbortsDone;
1262 unsigned short ControllerMemoryErrors;
1263 unsigned short ControllerHostCommandAbortsDone;
1266 unsigned short BackgroundInitializationsActive;
1267 unsigned short LogicalDeviceInitializationsActive;
1268 unsigned short PhysicalDeviceInitializationsActive;
1269 unsigned short ConsistencyChecksActive;
1270 unsigned short RebuildsActive;
1271 unsigned short OnlineExpansionsActive;
1272 unsigned short PatrolActivitiesActive;
1275 unsigned char FlashType;
1277 unsigned short FlashSizeMB;
1278 unsigned int FlashLimit;
1279 unsigned int FlashCount;
1281 unsigned char FlashTypeName[16];
1283 unsigned char RebuildRate;
1284 unsigned char BackgroundInitializationRate;
1285 unsigned char ForegroundInitializationRate;
1286 unsigned char ConsistencyCheckRate;
1288 unsigned int MaximumDP;
1289 unsigned int FreeDP;
1290 unsigned int MaximumIOP;
1291 unsigned int FreeIOP;
1292 unsigned short MaximumCombLengthInBlocks;
1293 unsigned short NumberOfConfigurationGroups;
1294 bool InstallationAbortStatus:1;
1295 bool MaintenanceModeStatus:1;
1297 unsigned char Reserved10[32];
1298 unsigned char Reserved11[512];
1314 DAC960_V2_LogicalDeviceState_T;
1333 DAC960_V2_ReadCacheDisabled = 0x0,
1334 DAC960_V2_ReadCacheEnabled = 0x1,
1335 DAC960_V2_ReadAheadEnabled = 0x2,
1336 DAC960_V2_IntelligentReadAheadEnabled = 0x3,
1337 DAC960_V2_ReadCache_Last = 0x7
1340 DAC960_V2_WriteCacheDisabled = 0x0,
1341 DAC960_V2_LogicalDeviceReadOnly = 0x1,
1342 DAC960_V2_WriteCacheEnabled = 0x2,
1343 DAC960_V2_IntelligentWriteCacheEnabled = 0x3,
1344 DAC960_V2_WriteCache_Last = 0x7
1347 bool LogicalDeviceInitialized:1;
1348 } LogicalDeviceControl;
1350 bool ConsistencyCheckInProgress:1;
1351 bool RebuildInProgress:1;
1352 bool BackgroundInitializationInProgress:1;
1353 bool ForegroundInitializationInProgress:1;
1354 bool DataMigrationInProgress:1;
1355 bool PatrolOperationInProgress:1;
1357 unsigned char RAID5WriteUpdate;
1358 unsigned char RAID5Algorithm;
1361 bool BIOSDisabled:1;
1362 bool CDROMBootEnabled:1;
1363 bool DriveCoercionEnabled:1;
1364 bool WriteSameDisabled:1;
1365 bool HBA_ModeEnabled:1;
1367 DAC960_V2_Geometry_128_32 = 0x0,
1368 DAC960_V2_Geometry_255_63 = 0x1,
1369 DAC960_V2_Geometry_Reserved1 = 0x2,
1370 DAC960_V2_Geometry_Reserved2 = 0x3
1372 bool SuperReadAheadEnabled:1;
1375 unsigned short SoftErrors;
1376 unsigned short CommandsFailed;
1377 unsigned short HostCommandAbortsDone;
1378 unsigned short DeferredWriteErrors;
1383 unsigned short DeviceBlockSizeInBytes;
1384 unsigned int OriginalDeviceSize;
1385 unsigned int ConfigurableDeviceSize;
1387 unsigned char LogicalDeviceName[32];
1388 unsigned char SCSI_InquiryData[36];
1398 unsigned char Reserved2[64];
1421 DAC960_V2_PhysicalDeviceState_T;
1435 bool PhysicalDeviceFaultTolerant:1;
1436 bool PhysicalDeviceConnected:1;
1437 bool PhysicalDeviceLocalToController:1;
1440 bool RemoteHostSystemDead:1;
1441 bool RemoteControllerDead:1;
1450 unsigned char NetworkAddress[16];
1453 bool ConsistencyCheckInProgress:1;
1454 bool RebuildInProgress:1;
1455 bool MakingDataConsistentInProgress:1;
1456 bool PhysicalDeviceInitializationInProgress:1;
1457 bool DataMigrationInProgress:1;
1458 bool PatrolOperationInProgress:1;
1475 unsigned char PhysicalDeviceName[16];
1477 unsigned char Reserved2[32];
1478 unsigned char SCSI_InquiryData[36];
1513 unsigned char Reserved2[64];
1533 unsigned char RequestSenseData[40];
1544 bool ForceUnitAccess:1;
1545 bool DisablePageOut:1;
1547 bool AdditionalScatterGatherListMemory:1;
1548 bool DataTransferControllerToHost:1;
1550 bool NoAutoRequestSense:1;
1551 bool DisconnectProhibited:1;
1562 unsigned char TimeoutValue:6;
1564 DAC960_V2_TimeoutScale_Seconds = 0,
1565 DAC960_V2_TimeoutScale_Minutes = 1,
1566 DAC960_V2_TimeoutScale_Hours = 2,
1567 DAC960_V2_TimeoutScale_Reserved = 3
1581 unsigned char Channel:3;
1585 DAC960_V2_PhysicalDevice_T;
1599 DAC960_V2_LogicalDevice_T;
1618 DAC960_V2_OperationDevice_T;
1665 } ExtendedScatterGather;
1676 unsigned int Words[16];
1700 unsigned char RequestSenseSize;
1702 unsigned char SCSI_CDB[10];
1704 DataTransferMemoryAddress;
1712 DAC960_V2_PhysicalDevice_T PhysicalDevice;
1714 unsigned char RequestSenseSize;
1715 unsigned char CDBLength;
1719 DataTransferMemoryAddress;
1726 unsigned char DataTransferPageNumber;
1731 unsigned char RequestSenseSize;
1732 unsigned char IOCTL_Opcode;
1735 DataTransferMemoryAddress;
1742 unsigned char DataTransferPageNumber;
1746 unsigned char RequestSenseSize;
1747 unsigned char IOCTL_Opcode;
1750 DataTransferMemoryAddress;
1751 } LogicalDeviceInfo;
1757 unsigned char DataTransferPageNumber;
1759 DAC960_V2_PhysicalDevice_T PhysicalDevice;
1761 unsigned char RequestSenseSize;
1762 unsigned char IOCTL_Opcode;
1765 DataTransferMemoryAddress;
1766 } PhysicalDeviceInfo;
1772 unsigned char DataTransferPageNumber;
1775 unsigned char ControllerNumber;
1777 unsigned char RequestSenseSize;
1778 unsigned char IOCTL_Opcode;
1782 DataTransferMemoryAddress;
1789 unsigned char DataTransferPageNumber;
1791 DAC960_V2_LogicalDevice_T LogicalDevice;
1793 unsigned char RequestSenseSize;
1794 unsigned char IOCTL_Opcode;
1801 DataTransferMemoryAddress;
1808 unsigned char DataTransferPageNumber;
1810 DAC960_V2_LogicalDevice_T LogicalDevice;
1812 unsigned char RequestSenseSize;
1813 unsigned char IOCTL_Opcode;
1814 bool RestoreConsistency:1;
1815 bool InitializedAreaOnly:1;
1819 DataTransferMemoryAddress;
1832 unsigned char RequestSenseSize;
1833 unsigned char IOCTL_Opcode;
1847 unsigned char DataTransferPageNumber;
1849 DAC960_V2_PhysicalDevice_T PhysicalDevice;
1851 unsigned char RequestSenseSize;
1852 unsigned char IOCTL_Opcode;
1856 DataTransferMemoryAddress;
1866 #define DAC960_IOCTL_GET_CONTROLLER_COUNT 0xDAC001
1867 #define DAC960_IOCTL_GET_CONTROLLER_INFO 0xDAC002
1868 #define DAC960_IOCTL_V1_EXECUTE_COMMAND 0xDAC003
1869 #define DAC960_IOCTL_V2_EXECUTE_COMMAND 0xDAC004
1870 #define DAC960_IOCTL_V2_GET_HEALTH_STATUS 0xDAC005
1888 unsigned char ModelName[20];
1889 unsigned char FirmwareVersion[12];
1985 #ifdef DAC960_DriverVersion
1993 #define DAC960_MaxDriverQueueDepth 511
1994 #define DAC960_MaxControllerQueueDepth 512
2002 #define DAC960_V1_ScatterGatherLimit 33
2003 #define DAC960_V2_ScatterGatherLimit 128
2011 #define DAC960_V1_CommandMailboxCount 256
2012 #define DAC960_V1_StatusMailboxCount 1024
2013 #define DAC960_V2_CommandMailboxCount 512
2014 #define DAC960_V2_StatusMailboxCount 512
2021 #define DAC960_MonitoringTimerInterval (10 * HZ)
2028 #define DAC960_SecondaryMonitoringInterval (60 * HZ)
2035 #define DAC960_HealthStatusMonitoringInterval (1 * HZ)
2042 #define DAC960_ProgressReportingInterval (60 * HZ)
2049 #define DAC960_MaxPartitions 8
2050 #define DAC960_MaxPartitionsBits 3
2056 #define DAC960_BlockSize 512
2057 #define DAC960_BlockSizeBits 9
2065 #define DAC960_V1_CommandAllocationGroupSize 11
2066 #define DAC960_V2_CommandAllocationGroupSize 29
2074 #define DAC960_LineBufferSize 100
2075 #define DAC960_ProgressBufferSize 200
2076 #define DAC960_UserMessageSize 200
2077 #define DAC960_InitialStatusBufferSize (8192-32)
2086 DAC960_V1_Controller = 1,
2087 DAC960_V2_Controller = 2
2089 DAC960_FirmwareType_T;
2098 DAC960_BA_Controller = 1,
2099 DAC960_LP_Controller = 2,
2100 DAC960_LA_Controller = 3,
2101 DAC960_PG_Controller = 4,
2102 DAC960_PD_Controller = 5,
2103 DAC960_P_Controller = 6,
2104 DAC960_GEM_Controller = 7,
2106 DAC960_HardwareType_T;
2113 typedef enum DAC960_MessageLevel
2115 DAC960_AnnounceLevel = 0,
2116 DAC960_InfoLevel = 1,
2117 DAC960_NoticeLevel = 2,
2118 DAC960_WarningLevel = 3,
2119 DAC960_ErrorLevel = 4,
2120 DAC960_ProgressLevel = 5,
2121 DAC960_CriticalLevel = 6,
2122 DAC960_UserCriticalLevel = 7
2124 DAC960_MessageLevel_T;
2127 *DAC960_MessageLevelMap[] =
2136 #define DAC960_Announce(Format, Arguments...) \
2137 DAC960_Message(DAC960_AnnounceLevel, Format, ##Arguments)
2139 #define DAC960_Info(Format, Arguments...) \
2140 DAC960_Message(DAC960_InfoLevel, Format, ##Arguments)
2142 #define DAC960_Notice(Format, Arguments...) \
2143 DAC960_Message(DAC960_NoticeLevel, Format, ##Arguments)
2145 #define DAC960_Warning(Format, Arguments...) \
2146 DAC960_Message(DAC960_WarningLevel, Format, ##Arguments)
2148 #define DAC960_Error(Format, Arguments...) \
2149 DAC960_Message(DAC960_ErrorLevel, Format, ##Arguments)
2151 #define DAC960_Progress(Format, Arguments...) \
2152 DAC960_Message(DAC960_ProgressLevel, Format, ##Arguments)
2154 #define DAC960_Critical(Format, Arguments...) \
2155 DAC960_Message(DAC960_CriticalLevel, Format, ##Arguments)
2157 #define DAC960_UserCritical(Format, Arguments...) \
2158 DAC960_Message(DAC960_UserCriticalLevel, Format, ##Arguments)
2161 struct DAC960_privdata {
2162 DAC960_HardwareType_T HardwareType;
2163 DAC960_FirmwareType_T FirmwareType;
2165 unsigned int MemoryWindowSize;
2173 typedef union DAC960_V1_StatusMailbox
2183 DAC960_V1_StatusMailbox_T;
2190 typedef union DAC960_V2_StatusMailbox
2192 unsigned int Words[2];
2196 unsigned char RequestSenseLength;
2197 int DataTransferResidue;
2200 DAC960_V2_StatusMailbox_T;
2209 DAC960_ReadCommand = 1,
2210 DAC960_WriteCommand = 2,
2211 DAC960_ReadRetryCommand = 3,
2212 DAC960_WriteRetryCommand = 4,
2213 DAC960_MonitoringCommand = 5,
2214 DAC960_ImmediateCommand = 6,
2215 DAC960_QueuedCommand = 7
2217 DAC960_CommandType_T;
2224 typedef struct DAC960_Command
2227 DAC960_CommandType_T CommandType;
2229 struct DAC960_Command *
Next;
2232 unsigned int BlockNumber;
2234 unsigned int SegmentCount;
2245 struct scatterlist ScatterList[DAC960_V1_ScatterGatherLimit];
2246 unsigned int EndMarker[0];
2252 unsigned char RequestSenseLength;
2253 int DataTransferResidue;
2258 struct scatterlist ScatterList[DAC960_V2_ScatterGatherLimit];
2259 unsigned int EndMarker[0];
2270 typedef struct DAC960_Controller
2273 void __iomem *MemoryMappedAddress;
2274 DAC960_FirmwareType_T FirmwareType;
2275 DAC960_HardwareType_T HardwareType;
2279 unsigned char ControllerNumber;
2280 unsigned char ControllerName[4];
2281 unsigned char ModelName[20];
2282 unsigned char FullModelName[28];
2283 unsigned char FirmwareVersion[12];
2286 unsigned char Function;
2287 unsigned char IRQ_Channel;
2288 unsigned char Channels;
2289 unsigned char Targets;
2290 unsigned char MemorySize;
2291 unsigned char LogicalDriveCount;
2292 unsigned short CommandAllocationGroupSize;
2293 unsigned short ControllerQueueDepth;
2294 unsigned short DriverQueueDepth;
2295 unsigned short MaxBlocksPerCommand;
2296 unsigned short ControllerScatterGatherLimit;
2297 unsigned short DriverScatterGatherLimit;
2298 u64 BounceBufferLimit;
2299 unsigned int CombinedStatusBufferLength;
2300 unsigned int InitialStatusLength;
2301 unsigned int CurrentStatusLength;
2302 unsigned int ProgressBufferLength;
2303 unsigned int UserStatusLength;
2305 unsigned long MonitoringTimerCount;
2306 unsigned long PrimaryMonitoringTime;
2307 unsigned long SecondaryMonitoringTime;
2308 unsigned long ShutdownMonitoringTimer;
2309 unsigned long LastProgressReportTime;
2310 unsigned long LastCurrentStatusTime;
2311 bool ControllerInitialized;
2312 bool MonitoringCommandDeferred;
2313 bool EphemeralProgressMessage;
2314 bool DriveSpinUpMessageDisplayed;
2315 bool MonitoringAlertMode;
2316 bool SuppressEnclosureMessages;
2319 struct pci_pool *ScatterGatherPool;
2320 DAC960_Command_T *FreeCommands;
2321 unsigned char *CombinedStatusBuffer;
2322 unsigned char *CurrentStatusBuffer;
2328 DAC960_Command_T InitialCommand;
2329 DAC960_Command_T *Commands[DAC960_MaxDriverQueueDepth];
2333 bool (*ReadControllerConfiguration)(
struct DAC960_Controller *);
2334 bool (*ReadDeviceConfiguration)(
struct DAC960_Controller *);
2335 bool (*ReportDeviceConfiguration)(
struct DAC960_Controller *);
2336 void (*QueueReadWriteCommand)(DAC960_Command_T *
Command);
2339 unsigned char GeometryTranslationHeads;
2340 unsigned char GeometryTranslationSectors;
2341 unsigned char PendingRebuildFlag;
2342 unsigned short StripeSize;
2343 unsigned short SegmentSize;
2344 unsigned short NewEventLogSequenceNumber;
2345 unsigned short OldEventLogSequenceNumber;
2346 unsigned short DeviceStateChannel;
2347 unsigned short DeviceStateTargetID;
2348 bool DualModeMemoryMailboxInterface;
2349 bool BackgroundInitializationStatusSupported;
2350 bool SAFTE_EnclosureManagementEnabled;
2351 bool NeedLogicalDriveInformation;
2352 bool NeedErrorTableInformation;
2353 bool NeedDeviceStateInformation;
2354 bool NeedDeviceInquiryInformation;
2355 bool NeedDeviceSerialNumberInformation;
2356 bool NeedRebuildProgress;
2357 bool NeedConsistencyCheckProgress;
2358 bool NeedBackgroundInitializationStatus;
2359 bool StartDeviceStateScan;
2360 bool RebuildProgressFirst;
2361 bool RebuildFlagPending;
2362 bool RebuildStatusPending;
2372 DAC960_V1_StatusMailbox_T *FirstStatusMailbox;
2373 DAC960_V1_StatusMailbox_T *LastStatusMailbox;
2374 DAC960_V1_StatusMailbox_T *NextStatusMailbox;
2379 DAC960_V1_Enquiry_T Enquiry;
2380 DAC960_V1_Enquiry_T *NewEnquiry;
2392 DAC960_V1_CommandStatus_T LastRebuildStatus;
2393 DAC960_V1_CommandStatus_T PendingRebuildStatus;
2400 *BackgroundInitializationStatus;
2401 dma_addr_t BackgroundInitializationStatusDMA;
2403 LastBackgroundInitializationStatus;
2424 unsigned int StatusChangeCounter;
2425 unsigned int NextEventSequenceNumber;
2426 unsigned int PhysicalDeviceIndex;
2427 bool NeedLogicalDeviceInformation;
2428 bool NeedPhysicalDeviceInformation;
2429 bool NeedDeviceSerialNumberInformation;
2430 bool StartLogicalDeviceInformationScan;
2431 bool StartPhysicalDeviceInformationScan;
2432 struct pci_pool *RequestSensePool;
2442 DAC960_V2_StatusMailbox_T *FirstStatusMailbox;
2443 DAC960_V2_StatusMailbox_T *LastStatusMailbox;
2444 DAC960_V2_StatusMailbox_T *NextStatusMailbox;
2474 DAC960_V2_PhysicalDevice_T
2479 unsigned char ProgressBuffer[DAC960_ProgressBufferSize];
2480 unsigned char UserStatusBuffer[DAC960_UserMessageSize];
2482 DAC960_Controller_T;
2492 #define DAC960_QueueCommand(Command) \
2493 (Controller->QueueCommand)(Command)
2494 #define DAC960_ReadControllerConfiguration(Controller) \
2495 (Controller->ReadControllerConfiguration)(Controller)
2496 #define DAC960_ReadDeviceConfiguration(Controller) \
2497 (Controller->ReadDeviceConfiguration)(Controller)
2498 #define DAC960_ReportDeviceConfiguration(Controller) \
2499 (Controller->ReportDeviceConfiguration)(Controller)
2500 #define DAC960_QueueReadWriteCommand(Command) \
2501 (Controller->QueueReadWriteCommand)(Command)
2526 writel(
u.wl[0], write_address);
2527 writel(
u.wl[1], write_address + 4);
2534 #define DAC960_GEM_RegisterWindowSize 0x600
2538 DAC960_GEM_InboundDoorBellRegisterReadSetOffset = 0x214,
2539 DAC960_GEM_InboundDoorBellRegisterClearOffset = 0x218,
2540 DAC960_GEM_OutboundDoorBellRegisterReadSetOffset = 0x224,
2541 DAC960_GEM_OutboundDoorBellRegisterClearOffset = 0x228,
2542 DAC960_GEM_InterruptStatusRegisterOffset = 0x208,
2543 DAC960_GEM_InterruptMaskRegisterReadSetOffset = 0x22C,
2544 DAC960_GEM_InterruptMaskRegisterClearOffset = 0x230,
2545 DAC960_GEM_CommandMailboxBusAddressOffset = 0x510,
2546 DAC960_GEM_CommandStatusOffset = 0x518,
2547 DAC960_GEM_ErrorStatusRegisterReadSetOffset = 0x224,
2548 DAC960_GEM_ErrorStatusRegisterClearOffset = 0x228,
2550 DAC960_GEM_RegisterOffsets_T;
2556 typedef union DAC960_GEM_InboundDoorBellRegister
2561 bool HardwareMailboxNewCommand:1;
2562 bool AcknowledgeHardwareMailboxStatus:1;
2563 bool GenerateInterrupt:1;
2564 bool ControllerReset:1;
2565 bool MemoryMailboxNewCommand:1;
2570 bool HardwareMailboxFull:1;
2571 bool InitializationInProgress:1;
2575 DAC960_GEM_InboundDoorBellRegister_T;
2580 typedef union DAC960_GEM_OutboundDoorBellRegister
2585 bool AcknowledgeHardwareMailboxInterrupt:1;
2586 bool AcknowledgeMemoryMailboxInterrupt:1;
2591 bool HardwareMailboxStatusAvailable:1;
2592 bool MemoryMailboxStatusAvailable:1;
2596 DAC960_GEM_OutboundDoorBellRegister_T;
2601 typedef union DAC960_GEM_InterruptMaskRegister
2607 unsigned int HardwareMailboxInterrupt:1;
2608 unsigned int MemoryMailboxInterrupt:1;
2612 DAC960_GEM_InterruptMaskRegister_T;
2618 typedef union DAC960_GEM_ErrorStatusRegister
2624 bool ErrorStatusPending:1;
2628 DAC960_GEM_ErrorStatusRegister_T;
2636 void DAC960_GEM_HardwareMailboxNewCommand(
void __iomem *ControllerBaseAddress)
2638 DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister;
2639 InboundDoorBellRegister.All = 0;
2640 InboundDoorBellRegister.Write.HardwareMailboxNewCommand =
true;
2641 writel(InboundDoorBellRegister.All,
2642 ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterReadSetOffset);
2646 void DAC960_GEM_AcknowledgeHardwareMailboxStatus(
void __iomem *ControllerBaseAddress)
2648 DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister;
2649 InboundDoorBellRegister.All = 0;
2650 InboundDoorBellRegister.Write.AcknowledgeHardwareMailboxStatus =
true;
2651 writel(InboundDoorBellRegister.All,
2652 ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterClearOffset);
2656 void DAC960_GEM_GenerateInterrupt(
void __iomem *ControllerBaseAddress)
2658 DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister;
2659 InboundDoorBellRegister.All = 0;
2660 InboundDoorBellRegister.Write.GenerateInterrupt =
true;
2661 writel(InboundDoorBellRegister.All,
2662 ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterReadSetOffset);
2666 void DAC960_GEM_ControllerReset(
void __iomem *ControllerBaseAddress)
2668 DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister;
2669 InboundDoorBellRegister.All = 0;
2670 InboundDoorBellRegister.Write.ControllerReset =
true;
2671 writel(InboundDoorBellRegister.All,
2672 ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterReadSetOffset);
2676 void DAC960_GEM_MemoryMailboxNewCommand(
void __iomem *ControllerBaseAddress)
2678 DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister;
2679 InboundDoorBellRegister.All = 0;
2680 InboundDoorBellRegister.Write.MemoryMailboxNewCommand =
true;
2681 writel(InboundDoorBellRegister.All,
2682 ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterReadSetOffset);
2686 bool DAC960_GEM_HardwareMailboxFullP(
void __iomem *ControllerBaseAddress)
2688 DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister;
2689 InboundDoorBellRegister.All =
2690 readl(ControllerBaseAddress +
2691 DAC960_GEM_InboundDoorBellRegisterReadSetOffset);
2692 return InboundDoorBellRegister.Read.HardwareMailboxFull;
2696 bool DAC960_GEM_InitializationInProgressP(
void __iomem *ControllerBaseAddress)
2698 DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister;
2699 InboundDoorBellRegister.All =
2700 readl(ControllerBaseAddress +
2701 DAC960_GEM_InboundDoorBellRegisterReadSetOffset);
2702 return InboundDoorBellRegister.Read.InitializationInProgress;
2706 void DAC960_GEM_AcknowledgeHardwareMailboxInterrupt(
void __iomem *ControllerBaseAddress)
2708 DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister;
2709 OutboundDoorBellRegister.All = 0;
2710 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
2711 writel(OutboundDoorBellRegister.All,
2712 ControllerBaseAddress + DAC960_GEM_OutboundDoorBellRegisterClearOffset);
2716 void DAC960_GEM_AcknowledgeMemoryMailboxInterrupt(
void __iomem *ControllerBaseAddress)
2718 DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister;
2719 OutboundDoorBellRegister.All = 0;
2720 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
2721 writel(OutboundDoorBellRegister.All,
2722 ControllerBaseAddress + DAC960_GEM_OutboundDoorBellRegisterClearOffset);
2726 void DAC960_GEM_AcknowledgeInterrupt(
void __iomem *ControllerBaseAddress)
2728 DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister;
2729 OutboundDoorBellRegister.All = 0;
2730 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
2731 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
2732 writel(OutboundDoorBellRegister.All,
2733 ControllerBaseAddress + DAC960_GEM_OutboundDoorBellRegisterClearOffset);
2737 bool DAC960_GEM_HardwareMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
2739 DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister;
2740 OutboundDoorBellRegister.All =
2741 readl(ControllerBaseAddress +
2742 DAC960_GEM_OutboundDoorBellRegisterReadSetOffset);
2743 return OutboundDoorBellRegister.Read.HardwareMailboxStatusAvailable;
2747 bool DAC960_GEM_MemoryMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
2749 DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister;
2750 OutboundDoorBellRegister.All =
2751 readl(ControllerBaseAddress +
2752 DAC960_GEM_OutboundDoorBellRegisterReadSetOffset);
2753 return OutboundDoorBellRegister.Read.MemoryMailboxStatusAvailable;
2757 void DAC960_GEM_EnableInterrupts(
void __iomem *ControllerBaseAddress)
2759 DAC960_GEM_InterruptMaskRegister_T InterruptMaskRegister;
2760 InterruptMaskRegister.All = 0;
2761 InterruptMaskRegister.Bits.HardwareMailboxInterrupt =
true;
2762 InterruptMaskRegister.Bits.MemoryMailboxInterrupt =
true;
2763 writel(InterruptMaskRegister.All,
2764 ControllerBaseAddress + DAC960_GEM_InterruptMaskRegisterClearOffset);
2768 void DAC960_GEM_DisableInterrupts(
void __iomem *ControllerBaseAddress)
2770 DAC960_GEM_InterruptMaskRegister_T InterruptMaskRegister;
2771 InterruptMaskRegister.All = 0;
2772 InterruptMaskRegister.Bits.HardwareMailboxInterrupt =
true;
2773 InterruptMaskRegister.Bits.MemoryMailboxInterrupt =
true;
2774 writel(InterruptMaskRegister.All,
2775 ControllerBaseAddress + DAC960_GEM_InterruptMaskRegisterReadSetOffset);
2779 bool DAC960_GEM_InterruptsEnabledP(
void __iomem *ControllerBaseAddress)
2781 DAC960_GEM_InterruptMaskRegister_T InterruptMaskRegister;
2782 InterruptMaskRegister.All =
2783 readl(ControllerBaseAddress +
2784 DAC960_GEM_InterruptMaskRegisterReadSetOffset);
2785 return !(InterruptMaskRegister.Bits.HardwareMailboxInterrupt ||
2786 InterruptMaskRegister.Bits.MemoryMailboxInterrupt);
2791 *MemoryCommandMailbox,
2798 MemoryCommandMailbox->
Words[0] = CommandMailbox->
Words[0];
2803 void DAC960_GEM_WriteHardwareMailbox(
void __iomem *ControllerBaseAddress,
2806 dma_addr_writeql(CommandMailboxDMA,
2807 ControllerBaseAddress +
2808 DAC960_GEM_CommandMailboxBusAddressOffset);
2811 static inline DAC960_V2_CommandIdentifier_T
2812 DAC960_GEM_ReadCommandIdentifier(
void __iomem *ControllerBaseAddress)
2814 return readw(ControllerBaseAddress + DAC960_GEM_CommandStatusOffset);
2817 static inline DAC960_V2_CommandStatus_T
2818 DAC960_GEM_ReadCommandStatus(
void __iomem *ControllerBaseAddress)
2820 return readw(ControllerBaseAddress + DAC960_GEM_CommandStatusOffset + 2);
2824 DAC960_GEM_ReadErrorStatus(
void __iomem *ControllerBaseAddress,
2825 unsigned char *ErrorStatus,
2826 unsigned char *Parameter0,
2827 unsigned char *Parameter1)
2829 DAC960_GEM_ErrorStatusRegister_T ErrorStatusRegister;
2830 ErrorStatusRegister.All =
2831 readl(ControllerBaseAddress + DAC960_GEM_ErrorStatusRegisterReadSetOffset);
2832 if (!ErrorStatusRegister.Bits.ErrorStatusPending)
return false;
2833 ErrorStatusRegister.Bits.ErrorStatusPending =
false;
2834 *ErrorStatus = ErrorStatusRegister.All;
2836 readb(ControllerBaseAddress + DAC960_GEM_CommandMailboxBusAddressOffset + 0);
2838 readb(ControllerBaseAddress + DAC960_GEM_CommandMailboxBusAddressOffset + 1);
2839 writel(0x03000000, ControllerBaseAddress +
2840 DAC960_GEM_ErrorStatusRegisterClearOffset);
2848 #define DAC960_BA_RegisterWindowSize 0x80
2852 DAC960_BA_InboundDoorBellRegisterOffset = 0x60,
2853 DAC960_BA_OutboundDoorBellRegisterOffset = 0x61,
2854 DAC960_BA_InterruptStatusRegisterOffset = 0x30,
2855 DAC960_BA_InterruptMaskRegisterOffset = 0x34,
2856 DAC960_BA_CommandMailboxBusAddressOffset = 0x50,
2857 DAC960_BA_CommandStatusOffset = 0x58,
2858 DAC960_BA_ErrorStatusRegisterOffset = 0x63
2860 DAC960_BA_RegisterOffsets_T;
2867 typedef union DAC960_BA_InboundDoorBellRegister
2871 bool HardwareMailboxNewCommand:1;
2872 bool AcknowledgeHardwareMailboxStatus:1;
2873 bool GenerateInterrupt:1;
2874 bool ControllerReset:1;
2875 bool MemoryMailboxNewCommand:1;
2879 bool HardwareMailboxEmpty:1;
2880 bool InitializationNotInProgress:1;
2884 DAC960_BA_InboundDoorBellRegister_T;
2891 typedef union DAC960_BA_OutboundDoorBellRegister
2895 bool AcknowledgeHardwareMailboxInterrupt:1;
2896 bool AcknowledgeMemoryMailboxInterrupt:1;
2900 bool HardwareMailboxStatusAvailable:1;
2901 bool MemoryMailboxStatusAvailable:1;
2905 DAC960_BA_OutboundDoorBellRegister_T;
2912 typedef union DAC960_BA_InterruptMaskRegister
2917 bool DisableInterrupts:1;
2918 bool DisableInterruptsI2O:1;
2922 DAC960_BA_InterruptMaskRegister_T;
2929 typedef union DAC960_BA_ErrorStatusRegister
2934 bool ErrorStatusPending:1;
2938 DAC960_BA_ErrorStatusRegister_T;
2947 void DAC960_BA_HardwareMailboxNewCommand(
void __iomem *ControllerBaseAddress)
2949 DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister;
2950 InboundDoorBellRegister.All = 0;
2951 InboundDoorBellRegister.Write.HardwareMailboxNewCommand =
true;
2952 writeb(InboundDoorBellRegister.All,
2953 ControllerBaseAddress + DAC960_BA_InboundDoorBellRegisterOffset);
2957 void DAC960_BA_AcknowledgeHardwareMailboxStatus(
void __iomem *ControllerBaseAddress)
2959 DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister;
2960 InboundDoorBellRegister.All = 0;
2961 InboundDoorBellRegister.Write.AcknowledgeHardwareMailboxStatus =
true;
2962 writeb(InboundDoorBellRegister.All,
2963 ControllerBaseAddress + DAC960_BA_InboundDoorBellRegisterOffset);
2967 void DAC960_BA_GenerateInterrupt(
void __iomem *ControllerBaseAddress)
2969 DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister;
2970 InboundDoorBellRegister.All = 0;
2971 InboundDoorBellRegister.Write.GenerateInterrupt =
true;
2972 writeb(InboundDoorBellRegister.All,
2973 ControllerBaseAddress + DAC960_BA_InboundDoorBellRegisterOffset);
2977 void DAC960_BA_ControllerReset(
void __iomem *ControllerBaseAddress)
2979 DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister;
2980 InboundDoorBellRegister.All = 0;
2981 InboundDoorBellRegister.Write.ControllerReset =
true;
2982 writeb(InboundDoorBellRegister.All,
2983 ControllerBaseAddress + DAC960_BA_InboundDoorBellRegisterOffset);
2987 void DAC960_BA_MemoryMailboxNewCommand(
void __iomem *ControllerBaseAddress)
2989 DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister;
2990 InboundDoorBellRegister.All = 0;
2991 InboundDoorBellRegister.Write.MemoryMailboxNewCommand =
true;
2992 writeb(InboundDoorBellRegister.All,
2993 ControllerBaseAddress + DAC960_BA_InboundDoorBellRegisterOffset);
2997 bool DAC960_BA_HardwareMailboxFullP(
void __iomem *ControllerBaseAddress)
2999 DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister;
3000 InboundDoorBellRegister.All =
3001 readb(ControllerBaseAddress + DAC960_BA_InboundDoorBellRegisterOffset);
3002 return !InboundDoorBellRegister.Read.HardwareMailboxEmpty;
3006 bool DAC960_BA_InitializationInProgressP(
void __iomem *ControllerBaseAddress)
3008 DAC960_BA_InboundDoorBellRegister_T InboundDoorBellRegister;
3009 InboundDoorBellRegister.All =
3010 readb(ControllerBaseAddress + DAC960_BA_InboundDoorBellRegisterOffset);
3011 return !InboundDoorBellRegister.Read.InitializationNotInProgress;
3015 void DAC960_BA_AcknowledgeHardwareMailboxInterrupt(
void __iomem *ControllerBaseAddress)
3017 DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3018 OutboundDoorBellRegister.All = 0;
3019 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
3020 writeb(OutboundDoorBellRegister.All,
3021 ControllerBaseAddress + DAC960_BA_OutboundDoorBellRegisterOffset);
3025 void DAC960_BA_AcknowledgeMemoryMailboxInterrupt(
void __iomem *ControllerBaseAddress)
3027 DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3028 OutboundDoorBellRegister.All = 0;
3029 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
3030 writeb(OutboundDoorBellRegister.All,
3031 ControllerBaseAddress + DAC960_BA_OutboundDoorBellRegisterOffset);
3035 void DAC960_BA_AcknowledgeInterrupt(
void __iomem *ControllerBaseAddress)
3037 DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3038 OutboundDoorBellRegister.All = 0;
3039 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
3040 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
3041 writeb(OutboundDoorBellRegister.All,
3042 ControllerBaseAddress + DAC960_BA_OutboundDoorBellRegisterOffset);
3046 bool DAC960_BA_HardwareMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
3048 DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3049 OutboundDoorBellRegister.All =
3050 readb(ControllerBaseAddress + DAC960_BA_OutboundDoorBellRegisterOffset);
3051 return OutboundDoorBellRegister.Read.HardwareMailboxStatusAvailable;
3055 bool DAC960_BA_MemoryMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
3057 DAC960_BA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3058 OutboundDoorBellRegister.All =
3059 readb(ControllerBaseAddress + DAC960_BA_OutboundDoorBellRegisterOffset);
3060 return OutboundDoorBellRegister.Read.MemoryMailboxStatusAvailable;
3064 void DAC960_BA_EnableInterrupts(
void __iomem *ControllerBaseAddress)
3066 DAC960_BA_InterruptMaskRegister_T InterruptMaskRegister;
3067 InterruptMaskRegister.All = 0xFF;
3068 InterruptMaskRegister.Bits.DisableInterrupts =
false;
3069 InterruptMaskRegister.Bits.DisableInterruptsI2O =
true;
3070 writeb(InterruptMaskRegister.All,
3071 ControllerBaseAddress + DAC960_BA_InterruptMaskRegisterOffset);
3075 void DAC960_BA_DisableInterrupts(
void __iomem *ControllerBaseAddress)
3077 DAC960_BA_InterruptMaskRegister_T InterruptMaskRegister;
3078 InterruptMaskRegister.All = 0xFF;
3079 InterruptMaskRegister.Bits.DisableInterrupts =
true;
3080 InterruptMaskRegister.Bits.DisableInterruptsI2O =
true;
3081 writeb(InterruptMaskRegister.All,
3082 ControllerBaseAddress + DAC960_BA_InterruptMaskRegisterOffset);
3086 bool DAC960_BA_InterruptsEnabledP(
void __iomem *ControllerBaseAddress)
3088 DAC960_BA_InterruptMaskRegister_T InterruptMaskRegister;
3089 InterruptMaskRegister.All =
3090 readb(ControllerBaseAddress + DAC960_BA_InterruptMaskRegisterOffset);
3091 return !InterruptMaskRegister.Bits.DisableInterrupts;
3096 *MemoryCommandMailbox,
3103 MemoryCommandMailbox->
Words[0] = CommandMailbox->
Words[0];
3109 void DAC960_BA_WriteHardwareMailbox(
void __iomem *ControllerBaseAddress,
3112 dma_addr_writeql(CommandMailboxDMA,
3113 ControllerBaseAddress +
3114 DAC960_BA_CommandMailboxBusAddressOffset);
3117 static inline DAC960_V2_CommandIdentifier_T
3118 DAC960_BA_ReadCommandIdentifier(
void __iomem *ControllerBaseAddress)
3120 return readw(ControllerBaseAddress + DAC960_BA_CommandStatusOffset);
3123 static inline DAC960_V2_CommandStatus_T
3124 DAC960_BA_ReadCommandStatus(
void __iomem *ControllerBaseAddress)
3126 return readw(ControllerBaseAddress + DAC960_BA_CommandStatusOffset + 2);
3130 DAC960_BA_ReadErrorStatus(
void __iomem *ControllerBaseAddress,
3131 unsigned char *ErrorStatus,
3132 unsigned char *Parameter0,
3133 unsigned char *Parameter1)
3135 DAC960_BA_ErrorStatusRegister_T ErrorStatusRegister;
3136 ErrorStatusRegister.All =
3137 readb(ControllerBaseAddress + DAC960_BA_ErrorStatusRegisterOffset);
3138 if (!ErrorStatusRegister.Bits.ErrorStatusPending)
return false;
3139 ErrorStatusRegister.Bits.ErrorStatusPending =
false;
3140 *ErrorStatus = ErrorStatusRegister.All;
3142 readb(ControllerBaseAddress + DAC960_BA_CommandMailboxBusAddressOffset + 0);
3144 readb(ControllerBaseAddress + DAC960_BA_CommandMailboxBusAddressOffset + 1);
3145 writeb(0xFF, ControllerBaseAddress + DAC960_BA_ErrorStatusRegisterOffset);
3154 #define DAC960_LP_RegisterWindowSize 0x80
3158 DAC960_LP_InboundDoorBellRegisterOffset = 0x20,
3159 DAC960_LP_OutboundDoorBellRegisterOffset = 0x2C,
3160 DAC960_LP_InterruptStatusRegisterOffset = 0x30,
3161 DAC960_LP_InterruptMaskRegisterOffset = 0x34,
3162 DAC960_LP_CommandMailboxBusAddressOffset = 0x10,
3163 DAC960_LP_CommandStatusOffset = 0x18,
3164 DAC960_LP_ErrorStatusRegisterOffset = 0x2E
3166 DAC960_LP_RegisterOffsets_T;
3173 typedef union DAC960_LP_InboundDoorBellRegister
3177 bool HardwareMailboxNewCommand:1;
3178 bool AcknowledgeHardwareMailboxStatus:1;
3179 bool GenerateInterrupt:1;
3180 bool ControllerReset:1;
3181 bool MemoryMailboxNewCommand:1;
3185 bool HardwareMailboxFull:1;
3186 bool InitializationInProgress:1;
3190 DAC960_LP_InboundDoorBellRegister_T;
3197 typedef union DAC960_LP_OutboundDoorBellRegister
3201 bool AcknowledgeHardwareMailboxInterrupt:1;
3202 bool AcknowledgeMemoryMailboxInterrupt:1;
3206 bool HardwareMailboxStatusAvailable:1;
3207 bool MemoryMailboxStatusAvailable:1;
3211 DAC960_LP_OutboundDoorBellRegister_T;
3218 typedef union DAC960_LP_InterruptMaskRegister
3223 bool DisableInterrupts:1;
3227 DAC960_LP_InterruptMaskRegister_T;
3234 typedef union DAC960_LP_ErrorStatusRegister
3239 bool ErrorStatusPending:1;
3243 DAC960_LP_ErrorStatusRegister_T;
3252 void DAC960_LP_HardwareMailboxNewCommand(
void __iomem *ControllerBaseAddress)
3254 DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister;
3255 InboundDoorBellRegister.All = 0;
3256 InboundDoorBellRegister.Write.HardwareMailboxNewCommand =
true;
3257 writeb(InboundDoorBellRegister.All,
3258 ControllerBaseAddress + DAC960_LP_InboundDoorBellRegisterOffset);
3262 void DAC960_LP_AcknowledgeHardwareMailboxStatus(
void __iomem *ControllerBaseAddress)
3264 DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister;
3265 InboundDoorBellRegister.All = 0;
3266 InboundDoorBellRegister.Write.AcknowledgeHardwareMailboxStatus =
true;
3267 writeb(InboundDoorBellRegister.All,
3268 ControllerBaseAddress + DAC960_LP_InboundDoorBellRegisterOffset);
3272 void DAC960_LP_GenerateInterrupt(
void __iomem *ControllerBaseAddress)
3274 DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister;
3275 InboundDoorBellRegister.All = 0;
3276 InboundDoorBellRegister.Write.GenerateInterrupt =
true;
3277 writeb(InboundDoorBellRegister.All,
3278 ControllerBaseAddress + DAC960_LP_InboundDoorBellRegisterOffset);
3282 void DAC960_LP_ControllerReset(
void __iomem *ControllerBaseAddress)
3284 DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister;
3285 InboundDoorBellRegister.All = 0;
3286 InboundDoorBellRegister.Write.ControllerReset =
true;
3287 writeb(InboundDoorBellRegister.All,
3288 ControllerBaseAddress + DAC960_LP_InboundDoorBellRegisterOffset);
3292 void DAC960_LP_MemoryMailboxNewCommand(
void __iomem *ControllerBaseAddress)
3294 DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister;
3295 InboundDoorBellRegister.All = 0;
3296 InboundDoorBellRegister.Write.MemoryMailboxNewCommand =
true;
3297 writeb(InboundDoorBellRegister.All,
3298 ControllerBaseAddress + DAC960_LP_InboundDoorBellRegisterOffset);
3302 bool DAC960_LP_HardwareMailboxFullP(
void __iomem *ControllerBaseAddress)
3304 DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister;
3305 InboundDoorBellRegister.All =
3306 readb(ControllerBaseAddress + DAC960_LP_InboundDoorBellRegisterOffset);
3307 return InboundDoorBellRegister.Read.HardwareMailboxFull;
3311 bool DAC960_LP_InitializationInProgressP(
void __iomem *ControllerBaseAddress)
3313 DAC960_LP_InboundDoorBellRegister_T InboundDoorBellRegister;
3314 InboundDoorBellRegister.All =
3315 readb(ControllerBaseAddress + DAC960_LP_InboundDoorBellRegisterOffset);
3316 return InboundDoorBellRegister.Read.InitializationInProgress;
3320 void DAC960_LP_AcknowledgeHardwareMailboxInterrupt(
void __iomem *ControllerBaseAddress)
3322 DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3323 OutboundDoorBellRegister.All = 0;
3324 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
3325 writeb(OutboundDoorBellRegister.All,
3326 ControllerBaseAddress + DAC960_LP_OutboundDoorBellRegisterOffset);
3330 void DAC960_LP_AcknowledgeMemoryMailboxInterrupt(
void __iomem *ControllerBaseAddress)
3332 DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3333 OutboundDoorBellRegister.All = 0;
3334 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
3335 writeb(OutboundDoorBellRegister.All,
3336 ControllerBaseAddress + DAC960_LP_OutboundDoorBellRegisterOffset);
3340 void DAC960_LP_AcknowledgeInterrupt(
void __iomem *ControllerBaseAddress)
3342 DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3343 OutboundDoorBellRegister.All = 0;
3344 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
3345 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
3346 writeb(OutboundDoorBellRegister.All,
3347 ControllerBaseAddress + DAC960_LP_OutboundDoorBellRegisterOffset);
3351 bool DAC960_LP_HardwareMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
3353 DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3354 OutboundDoorBellRegister.All =
3355 readb(ControllerBaseAddress + DAC960_LP_OutboundDoorBellRegisterOffset);
3356 return OutboundDoorBellRegister.Read.HardwareMailboxStatusAvailable;
3360 bool DAC960_LP_MemoryMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
3362 DAC960_LP_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3363 OutboundDoorBellRegister.All =
3364 readb(ControllerBaseAddress + DAC960_LP_OutboundDoorBellRegisterOffset);
3365 return OutboundDoorBellRegister.Read.MemoryMailboxStatusAvailable;
3369 void DAC960_LP_EnableInterrupts(
void __iomem *ControllerBaseAddress)
3371 DAC960_LP_InterruptMaskRegister_T InterruptMaskRegister;
3372 InterruptMaskRegister.All = 0xFF;
3373 InterruptMaskRegister.Bits.DisableInterrupts =
false;
3374 writeb(InterruptMaskRegister.All,
3375 ControllerBaseAddress + DAC960_LP_InterruptMaskRegisterOffset);
3379 void DAC960_LP_DisableInterrupts(
void __iomem *ControllerBaseAddress)
3381 DAC960_LP_InterruptMaskRegister_T InterruptMaskRegister;
3382 InterruptMaskRegister.All = 0xFF;
3383 InterruptMaskRegister.Bits.DisableInterrupts =
true;
3384 writeb(InterruptMaskRegister.All,
3385 ControllerBaseAddress + DAC960_LP_InterruptMaskRegisterOffset);
3389 bool DAC960_LP_InterruptsEnabledP(
void __iomem *ControllerBaseAddress)
3391 DAC960_LP_InterruptMaskRegister_T InterruptMaskRegister;
3392 InterruptMaskRegister.All =
3393 readb(ControllerBaseAddress + DAC960_LP_InterruptMaskRegisterOffset);
3394 return !InterruptMaskRegister.Bits.DisableInterrupts;
3399 *MemoryCommandMailbox,
3406 MemoryCommandMailbox->
Words[0] = CommandMailbox->
Words[0];
3411 void DAC960_LP_WriteHardwareMailbox(
void __iomem *ControllerBaseAddress,
3414 dma_addr_writeql(CommandMailboxDMA,
3415 ControllerBaseAddress +
3416 DAC960_LP_CommandMailboxBusAddressOffset);
3419 static inline DAC960_V2_CommandIdentifier_T
3420 DAC960_LP_ReadCommandIdentifier(
void __iomem *ControllerBaseAddress)
3422 return readw(ControllerBaseAddress + DAC960_LP_CommandStatusOffset);
3425 static inline DAC960_V2_CommandStatus_T
3426 DAC960_LP_ReadCommandStatus(
void __iomem *ControllerBaseAddress)
3428 return readw(ControllerBaseAddress + DAC960_LP_CommandStatusOffset + 2);
3432 DAC960_LP_ReadErrorStatus(
void __iomem *ControllerBaseAddress,
3433 unsigned char *ErrorStatus,
3434 unsigned char *Parameter0,
3435 unsigned char *Parameter1)
3437 DAC960_LP_ErrorStatusRegister_T ErrorStatusRegister;
3438 ErrorStatusRegister.All =
3439 readb(ControllerBaseAddress + DAC960_LP_ErrorStatusRegisterOffset);
3440 if (!ErrorStatusRegister.Bits.ErrorStatusPending)
return false;
3441 ErrorStatusRegister.Bits.ErrorStatusPending =
false;
3442 *ErrorStatus = ErrorStatusRegister.All;
3444 readb(ControllerBaseAddress + DAC960_LP_CommandMailboxBusAddressOffset + 0);
3446 readb(ControllerBaseAddress + DAC960_LP_CommandMailboxBusAddressOffset + 1);
3447 writeb(0xFF, ControllerBaseAddress + DAC960_LP_ErrorStatusRegisterOffset);
3456 #define DAC960_LA_RegisterWindowSize 0x80
3460 DAC960_LA_InboundDoorBellRegisterOffset = 0x60,
3461 DAC960_LA_OutboundDoorBellRegisterOffset = 0x61,
3462 DAC960_LA_InterruptMaskRegisterOffset = 0x34,
3463 DAC960_LA_CommandOpcodeRegisterOffset = 0x50,
3464 DAC960_LA_CommandIdentifierRegisterOffset = 0x51,
3465 DAC960_LA_MailboxRegister2Offset = 0x52,
3466 DAC960_LA_MailboxRegister3Offset = 0x53,
3467 DAC960_LA_MailboxRegister4Offset = 0x54,
3468 DAC960_LA_MailboxRegister5Offset = 0x55,
3469 DAC960_LA_MailboxRegister6Offset = 0x56,
3470 DAC960_LA_MailboxRegister7Offset = 0x57,
3471 DAC960_LA_MailboxRegister8Offset = 0x58,
3472 DAC960_LA_MailboxRegister9Offset = 0x59,
3473 DAC960_LA_MailboxRegister10Offset = 0x5A,
3474 DAC960_LA_MailboxRegister11Offset = 0x5B,
3475 DAC960_LA_MailboxRegister12Offset = 0x5C,
3476 DAC960_LA_StatusCommandIdentifierRegOffset = 0x5D,
3477 DAC960_LA_StatusRegisterOffset = 0x5E,
3478 DAC960_LA_ErrorStatusRegisterOffset = 0x63
3480 DAC960_LA_RegisterOffsets_T;
3487 typedef union DAC960_LA_InboundDoorBellRegister
3491 bool HardwareMailboxNewCommand:1;
3492 bool AcknowledgeHardwareMailboxStatus:1;
3493 bool GenerateInterrupt:1;
3494 bool ControllerReset:1;
3495 bool MemoryMailboxNewCommand:1;
3499 bool HardwareMailboxEmpty:1;
3500 bool InitializationNotInProgress:1;
3504 DAC960_LA_InboundDoorBellRegister_T;
3511 typedef union DAC960_LA_OutboundDoorBellRegister
3515 bool AcknowledgeHardwareMailboxInterrupt:1;
3516 bool AcknowledgeMemoryMailboxInterrupt:1;
3520 bool HardwareMailboxStatusAvailable:1;
3521 bool MemoryMailboxStatusAvailable:1;
3525 DAC960_LA_OutboundDoorBellRegister_T;
3532 typedef union DAC960_LA_InterruptMaskRegister
3537 bool DisableInterrupts:1;
3541 DAC960_LA_InterruptMaskRegister_T;
3548 typedef union DAC960_LA_ErrorStatusRegister
3553 bool ErrorStatusPending:1;
3557 DAC960_LA_ErrorStatusRegister_T;
3566 void DAC960_LA_HardwareMailboxNewCommand(
void __iomem *ControllerBaseAddress)
3568 DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister;
3569 InboundDoorBellRegister.All = 0;
3570 InboundDoorBellRegister.Write.HardwareMailboxNewCommand =
true;
3571 writeb(InboundDoorBellRegister.All,
3572 ControllerBaseAddress + DAC960_LA_InboundDoorBellRegisterOffset);
3576 void DAC960_LA_AcknowledgeHardwareMailboxStatus(
void __iomem *ControllerBaseAddress)
3578 DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister;
3579 InboundDoorBellRegister.All = 0;
3580 InboundDoorBellRegister.Write.AcknowledgeHardwareMailboxStatus =
true;
3581 writeb(InboundDoorBellRegister.All,
3582 ControllerBaseAddress + DAC960_LA_InboundDoorBellRegisterOffset);
3586 void DAC960_LA_GenerateInterrupt(
void __iomem *ControllerBaseAddress)
3588 DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister;
3589 InboundDoorBellRegister.All = 0;
3590 InboundDoorBellRegister.Write.GenerateInterrupt =
true;
3591 writeb(InboundDoorBellRegister.All,
3592 ControllerBaseAddress + DAC960_LA_InboundDoorBellRegisterOffset);
3596 void DAC960_LA_ControllerReset(
void __iomem *ControllerBaseAddress)
3598 DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister;
3599 InboundDoorBellRegister.All = 0;
3600 InboundDoorBellRegister.Write.ControllerReset =
true;
3601 writeb(InboundDoorBellRegister.All,
3602 ControllerBaseAddress + DAC960_LA_InboundDoorBellRegisterOffset);
3606 void DAC960_LA_MemoryMailboxNewCommand(
void __iomem *ControllerBaseAddress)
3608 DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister;
3609 InboundDoorBellRegister.All = 0;
3610 InboundDoorBellRegister.Write.MemoryMailboxNewCommand =
true;
3611 writeb(InboundDoorBellRegister.All,
3612 ControllerBaseAddress + DAC960_LA_InboundDoorBellRegisterOffset);
3616 bool DAC960_LA_HardwareMailboxFullP(
void __iomem *ControllerBaseAddress)
3618 DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister;
3619 InboundDoorBellRegister.All =
3620 readb(ControllerBaseAddress + DAC960_LA_InboundDoorBellRegisterOffset);
3621 return !InboundDoorBellRegister.Read.HardwareMailboxEmpty;
3625 bool DAC960_LA_InitializationInProgressP(
void __iomem *ControllerBaseAddress)
3627 DAC960_LA_InboundDoorBellRegister_T InboundDoorBellRegister;
3628 InboundDoorBellRegister.All =
3629 readb(ControllerBaseAddress + DAC960_LA_InboundDoorBellRegisterOffset);
3630 return !InboundDoorBellRegister.Read.InitializationNotInProgress;
3634 void DAC960_LA_AcknowledgeHardwareMailboxInterrupt(
void __iomem *ControllerBaseAddress)
3636 DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3637 OutboundDoorBellRegister.All = 0;
3638 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
3639 writeb(OutboundDoorBellRegister.All,
3640 ControllerBaseAddress + DAC960_LA_OutboundDoorBellRegisterOffset);
3644 void DAC960_LA_AcknowledgeMemoryMailboxInterrupt(
void __iomem *ControllerBaseAddress)
3646 DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3647 OutboundDoorBellRegister.All = 0;
3648 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
3649 writeb(OutboundDoorBellRegister.All,
3650 ControllerBaseAddress + DAC960_LA_OutboundDoorBellRegisterOffset);
3654 void DAC960_LA_AcknowledgeInterrupt(
void __iomem *ControllerBaseAddress)
3656 DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3657 OutboundDoorBellRegister.All = 0;
3658 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
3659 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
3660 writeb(OutboundDoorBellRegister.All,
3661 ControllerBaseAddress + DAC960_LA_OutboundDoorBellRegisterOffset);
3665 bool DAC960_LA_HardwareMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
3667 DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3668 OutboundDoorBellRegister.All =
3669 readb(ControllerBaseAddress + DAC960_LA_OutboundDoorBellRegisterOffset);
3670 return OutboundDoorBellRegister.Read.HardwareMailboxStatusAvailable;
3674 bool DAC960_LA_MemoryMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
3676 DAC960_LA_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3677 OutboundDoorBellRegister.All =
3678 readb(ControllerBaseAddress + DAC960_LA_OutboundDoorBellRegisterOffset);
3679 return OutboundDoorBellRegister.Read.MemoryMailboxStatusAvailable;
3683 void DAC960_LA_EnableInterrupts(
void __iomem *ControllerBaseAddress)
3685 DAC960_LA_InterruptMaskRegister_T InterruptMaskRegister;
3686 InterruptMaskRegister.All = 0xFF;
3687 InterruptMaskRegister.Bits.DisableInterrupts =
false;
3688 writeb(InterruptMaskRegister.All,
3689 ControllerBaseAddress + DAC960_LA_InterruptMaskRegisterOffset);
3693 void DAC960_LA_DisableInterrupts(
void __iomem *ControllerBaseAddress)
3695 DAC960_LA_InterruptMaskRegister_T InterruptMaskRegister;
3696 InterruptMaskRegister.All = 0xFF;
3697 InterruptMaskRegister.Bits.DisableInterrupts =
true;
3698 writeb(InterruptMaskRegister.All,
3699 ControllerBaseAddress + DAC960_LA_InterruptMaskRegisterOffset);
3703 bool DAC960_LA_InterruptsEnabledP(
void __iomem *ControllerBaseAddress)
3705 DAC960_LA_InterruptMaskRegister_T InterruptMaskRegister;
3706 InterruptMaskRegister.All =
3707 readb(ControllerBaseAddress + DAC960_LA_InterruptMaskRegisterOffset);
3708 return !InterruptMaskRegister.Bits.DisableInterrupts;
3713 *MemoryCommandMailbox,
3717 MemoryCommandMailbox->
Words[1] = CommandMailbox->
Words[1];
3718 MemoryCommandMailbox->
Words[2] = CommandMailbox->
Words[2];
3719 MemoryCommandMailbox->
Words[3] = CommandMailbox->
Words[3];
3721 MemoryCommandMailbox->
Words[0] = CommandMailbox->
Words[0];
3726 void DAC960_LA_WriteHardwareMailbox(
void __iomem *ControllerBaseAddress,
3730 ControllerBaseAddress + DAC960_LA_CommandOpcodeRegisterOffset);
3732 ControllerBaseAddress + DAC960_LA_MailboxRegister4Offset);
3734 ControllerBaseAddress + DAC960_LA_MailboxRegister8Offset);
3736 ControllerBaseAddress + DAC960_LA_MailboxRegister12Offset);
3739 static inline DAC960_V1_CommandIdentifier_T
3740 DAC960_LA_ReadStatusCommandIdentifier(
void __iomem *ControllerBaseAddress)
3742 return readb(ControllerBaseAddress
3743 + DAC960_LA_StatusCommandIdentifierRegOffset);
3746 static inline DAC960_V1_CommandStatus_T
3747 DAC960_LA_ReadStatusRegister(
void __iomem *ControllerBaseAddress)
3749 return readw(ControllerBaseAddress + DAC960_LA_StatusRegisterOffset);
3753 DAC960_LA_ReadErrorStatus(
void __iomem *ControllerBaseAddress,
3754 unsigned char *ErrorStatus,
3755 unsigned char *Parameter0,
3756 unsigned char *Parameter1)
3758 DAC960_LA_ErrorStatusRegister_T ErrorStatusRegister;
3759 ErrorStatusRegister.All =
3760 readb(ControllerBaseAddress + DAC960_LA_ErrorStatusRegisterOffset);
3761 if (!ErrorStatusRegister.Bits.ErrorStatusPending)
return false;
3762 ErrorStatusRegister.Bits.ErrorStatusPending =
false;
3763 *ErrorStatus = ErrorStatusRegister.All;
3765 readb(ControllerBaseAddress + DAC960_LA_CommandOpcodeRegisterOffset);
3767 readb(ControllerBaseAddress + DAC960_LA_CommandIdentifierRegisterOffset);
3768 writeb(0xFF, ControllerBaseAddress + DAC960_LA_ErrorStatusRegisterOffset);
3776 #define DAC960_PG_RegisterWindowSize 0x2000
3780 DAC960_PG_InboundDoorBellRegisterOffset = 0x0020,
3781 DAC960_PG_OutboundDoorBellRegisterOffset = 0x002C,
3782 DAC960_PG_InterruptMaskRegisterOffset = 0x0034,
3783 DAC960_PG_CommandOpcodeRegisterOffset = 0x1000,
3784 DAC960_PG_CommandIdentifierRegisterOffset = 0x1001,
3785 DAC960_PG_MailboxRegister2Offset = 0x1002,
3786 DAC960_PG_MailboxRegister3Offset = 0x1003,
3787 DAC960_PG_MailboxRegister4Offset = 0x1004,
3788 DAC960_PG_MailboxRegister5Offset = 0x1005,
3789 DAC960_PG_MailboxRegister6Offset = 0x1006,
3790 DAC960_PG_MailboxRegister7Offset = 0x1007,
3791 DAC960_PG_MailboxRegister8Offset = 0x1008,
3792 DAC960_PG_MailboxRegister9Offset = 0x1009,
3793 DAC960_PG_MailboxRegister10Offset = 0x100A,
3794 DAC960_PG_MailboxRegister11Offset = 0x100B,
3795 DAC960_PG_MailboxRegister12Offset = 0x100C,
3796 DAC960_PG_StatusCommandIdentifierRegOffset = 0x1018,
3797 DAC960_PG_StatusRegisterOffset = 0x101A,
3798 DAC960_PG_ErrorStatusRegisterOffset = 0x103F
3800 DAC960_PG_RegisterOffsets_T;
3807 typedef union DAC960_PG_InboundDoorBellRegister
3811 bool HardwareMailboxNewCommand:1;
3812 bool AcknowledgeHardwareMailboxStatus:1;
3813 bool GenerateInterrupt:1;
3814 bool ControllerReset:1;
3815 bool MemoryMailboxNewCommand:1;
3819 bool HardwareMailboxFull:1;
3820 bool InitializationInProgress:1;
3824 DAC960_PG_InboundDoorBellRegister_T;
3831 typedef union DAC960_PG_OutboundDoorBellRegister
3835 bool AcknowledgeHardwareMailboxInterrupt:1;
3836 bool AcknowledgeMemoryMailboxInterrupt:1;
3840 bool HardwareMailboxStatusAvailable:1;
3841 bool MemoryMailboxStatusAvailable:1;
3845 DAC960_PG_OutboundDoorBellRegister_T;
3852 typedef union DAC960_PG_InterruptMaskRegister
3856 unsigned int MessageUnitInterruptMask1:2;
3857 bool DisableInterrupts:1;
3858 unsigned int MessageUnitInterruptMask2:5;
3862 DAC960_PG_InterruptMaskRegister_T;
3869 typedef union DAC960_PG_ErrorStatusRegister
3874 bool ErrorStatusPending:1;
3878 DAC960_PG_ErrorStatusRegister_T;
3887 void DAC960_PG_HardwareMailboxNewCommand(
void __iomem *ControllerBaseAddress)
3889 DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister;
3890 InboundDoorBellRegister.All = 0;
3891 InboundDoorBellRegister.Write.HardwareMailboxNewCommand =
true;
3892 writel(InboundDoorBellRegister.All,
3893 ControllerBaseAddress + DAC960_PG_InboundDoorBellRegisterOffset);
3897 void DAC960_PG_AcknowledgeHardwareMailboxStatus(
void __iomem *ControllerBaseAddress)
3899 DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister;
3900 InboundDoorBellRegister.All = 0;
3901 InboundDoorBellRegister.Write.AcknowledgeHardwareMailboxStatus =
true;
3902 writel(InboundDoorBellRegister.All,
3903 ControllerBaseAddress + DAC960_PG_InboundDoorBellRegisterOffset);
3907 void DAC960_PG_GenerateInterrupt(
void __iomem *ControllerBaseAddress)
3909 DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister;
3910 InboundDoorBellRegister.All = 0;
3911 InboundDoorBellRegister.Write.GenerateInterrupt =
true;
3912 writel(InboundDoorBellRegister.All,
3913 ControllerBaseAddress + DAC960_PG_InboundDoorBellRegisterOffset);
3917 void DAC960_PG_ControllerReset(
void __iomem *ControllerBaseAddress)
3919 DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister;
3920 InboundDoorBellRegister.All = 0;
3921 InboundDoorBellRegister.Write.ControllerReset =
true;
3922 writel(InboundDoorBellRegister.All,
3923 ControllerBaseAddress + DAC960_PG_InboundDoorBellRegisterOffset);
3927 void DAC960_PG_MemoryMailboxNewCommand(
void __iomem *ControllerBaseAddress)
3929 DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister;
3930 InboundDoorBellRegister.All = 0;
3931 InboundDoorBellRegister.Write.MemoryMailboxNewCommand =
true;
3932 writel(InboundDoorBellRegister.All,
3933 ControllerBaseAddress + DAC960_PG_InboundDoorBellRegisterOffset);
3937 bool DAC960_PG_HardwareMailboxFullP(
void __iomem *ControllerBaseAddress)
3939 DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister;
3940 InboundDoorBellRegister.All =
3941 readl(ControllerBaseAddress + DAC960_PG_InboundDoorBellRegisterOffset);
3942 return InboundDoorBellRegister.Read.HardwareMailboxFull;
3946 bool DAC960_PG_InitializationInProgressP(
void __iomem *ControllerBaseAddress)
3948 DAC960_PG_InboundDoorBellRegister_T InboundDoorBellRegister;
3949 InboundDoorBellRegister.All =
3950 readl(ControllerBaseAddress + DAC960_PG_InboundDoorBellRegisterOffset);
3951 return InboundDoorBellRegister.Read.InitializationInProgress;
3955 void DAC960_PG_AcknowledgeHardwareMailboxInterrupt(
void __iomem *ControllerBaseAddress)
3957 DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3958 OutboundDoorBellRegister.All = 0;
3959 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
3960 writel(OutboundDoorBellRegister.All,
3961 ControllerBaseAddress + DAC960_PG_OutboundDoorBellRegisterOffset);
3965 void DAC960_PG_AcknowledgeMemoryMailboxInterrupt(
void __iomem *ControllerBaseAddress)
3967 DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3968 OutboundDoorBellRegister.All = 0;
3969 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
3970 writel(OutboundDoorBellRegister.All,
3971 ControllerBaseAddress + DAC960_PG_OutboundDoorBellRegisterOffset);
3975 void DAC960_PG_AcknowledgeInterrupt(
void __iomem *ControllerBaseAddress)
3977 DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3978 OutboundDoorBellRegister.All = 0;
3979 OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt =
true;
3980 OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt =
true;
3981 writel(OutboundDoorBellRegister.All,
3982 ControllerBaseAddress + DAC960_PG_OutboundDoorBellRegisterOffset);
3986 bool DAC960_PG_HardwareMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
3988 DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3989 OutboundDoorBellRegister.All =
3990 readl(ControllerBaseAddress + DAC960_PG_OutboundDoorBellRegisterOffset);
3991 return OutboundDoorBellRegister.Read.HardwareMailboxStatusAvailable;
3995 bool DAC960_PG_MemoryMailboxStatusAvailableP(
void __iomem *ControllerBaseAddress)
3997 DAC960_PG_OutboundDoorBellRegister_T OutboundDoorBellRegister;
3998 OutboundDoorBellRegister.All =
3999 readl(ControllerBaseAddress + DAC960_PG_OutboundDoorBellRegisterOffset);
4000 return OutboundDoorBellRegister.Read.MemoryMailboxStatusAvailable;
4004 void DAC960_PG_EnableInterrupts(
void __iomem *ControllerBaseAddress)
4006 DAC960_PG_InterruptMaskRegister_T InterruptMaskRegister;
4007 InterruptMaskRegister.All = 0;
4008 InterruptMaskRegister.Bits.MessageUnitInterruptMask1 = 0x3;
4009 InterruptMaskRegister.Bits.DisableInterrupts =
false;
4010 InterruptMaskRegister.Bits.MessageUnitInterruptMask2 = 0x1F;
4011 writel(InterruptMaskRegister.All,
4012 ControllerBaseAddress + DAC960_PG_InterruptMaskRegisterOffset);
4016 void DAC960_PG_DisableInterrupts(
void __iomem *ControllerBaseAddress)
4018 DAC960_PG_InterruptMaskRegister_T InterruptMaskRegister;
4019 InterruptMaskRegister.All = 0;
4020 InterruptMaskRegister.Bits.MessageUnitInterruptMask1 = 0x3;
4021 InterruptMaskRegister.Bits.DisableInterrupts =
true;
4022 InterruptMaskRegister.Bits.MessageUnitInterruptMask2 = 0x1F;
4023 writel(InterruptMaskRegister.All,
4024 ControllerBaseAddress + DAC960_PG_InterruptMaskRegisterOffset);
4028 bool DAC960_PG_InterruptsEnabledP(
void __iomem *ControllerBaseAddress)
4030 DAC960_PG_InterruptMaskRegister_T InterruptMaskRegister;
4031 InterruptMaskRegister.All =
4032 readl(ControllerBaseAddress + DAC960_PG_InterruptMaskRegisterOffset);
4033 return !InterruptMaskRegister.Bits.DisableInterrupts;
4038 *MemoryCommandMailbox,
4042 MemoryCommandMailbox->
Words[1] = CommandMailbox->
Words[1];
4043 MemoryCommandMailbox->
Words[2] = CommandMailbox->
Words[2];
4044 MemoryCommandMailbox->
Words[3] = CommandMailbox->
Words[3];
4046 MemoryCommandMailbox->
Words[0] = CommandMailbox->
Words[0];
4051 void DAC960_PG_WriteHardwareMailbox(
void __iomem *ControllerBaseAddress,
4055 ControllerBaseAddress + DAC960_PG_CommandOpcodeRegisterOffset);
4057 ControllerBaseAddress + DAC960_PG_MailboxRegister4Offset);
4059 ControllerBaseAddress + DAC960_PG_MailboxRegister8Offset);
4061 ControllerBaseAddress + DAC960_PG_MailboxRegister12Offset);
4064 static inline DAC960_V1_CommandIdentifier_T
4065 DAC960_PG_ReadStatusCommandIdentifier(
void __iomem *ControllerBaseAddress)
4067 return readb(ControllerBaseAddress
4068 + DAC960_PG_StatusCommandIdentifierRegOffset);
4071 static inline DAC960_V1_CommandStatus_T
4072 DAC960_PG_ReadStatusRegister(
void __iomem *ControllerBaseAddress)
4074 return readw(ControllerBaseAddress + DAC960_PG_StatusRegisterOffset);
4078 DAC960_PG_ReadErrorStatus(
void __iomem *ControllerBaseAddress,
4079 unsigned char *ErrorStatus,
4080 unsigned char *Parameter0,
4081 unsigned char *Parameter1)
4083 DAC960_PG_ErrorStatusRegister_T ErrorStatusRegister;
4084 ErrorStatusRegister.All =
4085 readb(ControllerBaseAddress + DAC960_PG_ErrorStatusRegisterOffset);
4086 if (!ErrorStatusRegister.Bits.ErrorStatusPending)
return false;
4087 ErrorStatusRegister.Bits.ErrorStatusPending =
false;
4088 *ErrorStatus = ErrorStatusRegister.All;
4090 readb(ControllerBaseAddress + DAC960_PG_CommandOpcodeRegisterOffset);
4092 readb(ControllerBaseAddress + DAC960_PG_CommandIdentifierRegisterOffset);
4093 writeb(0, ControllerBaseAddress + DAC960_PG_ErrorStatusRegisterOffset);
4101 #define DAC960_PD_RegisterWindowSize 0x80
4105 DAC960_PD_CommandOpcodeRegisterOffset = 0x00,
4106 DAC960_PD_CommandIdentifierRegisterOffset = 0x01,
4107 DAC960_PD_MailboxRegister2Offset = 0x02,
4108 DAC960_PD_MailboxRegister3Offset = 0x03,
4109 DAC960_PD_MailboxRegister4Offset = 0x04,
4110 DAC960_PD_MailboxRegister5Offset = 0x05,
4111 DAC960_PD_MailboxRegister6Offset = 0x06,
4112 DAC960_PD_MailboxRegister7Offset = 0x07,
4113 DAC960_PD_MailboxRegister8Offset = 0x08,
4114 DAC960_PD_MailboxRegister9Offset = 0x09,
4115 DAC960_PD_MailboxRegister10Offset = 0x0A,
4116 DAC960_PD_MailboxRegister11Offset = 0x0B,
4117 DAC960_PD_MailboxRegister12Offset = 0x0C,
4118 DAC960_PD_StatusCommandIdentifierRegOffset = 0x0D,
4119 DAC960_PD_StatusRegisterOffset = 0x0E,
4120 DAC960_PD_ErrorStatusRegisterOffset = 0x3F,
4121 DAC960_PD_InboundDoorBellRegisterOffset = 0x40,
4122 DAC960_PD_OutboundDoorBellRegisterOffset = 0x41,
4123 DAC960_PD_InterruptEnableRegisterOffset = 0x43
4125 DAC960_PD_RegisterOffsets_T;
4132 typedef union DAC960_PD_InboundDoorBellRegister
4137 bool AcknowledgeStatus:1;
4138 bool GenerateInterrupt:1;
4139 bool ControllerReset:1;
4144 bool InitializationInProgress:1;
4148 DAC960_PD_InboundDoorBellRegister_T;
4155 typedef union DAC960_PD_OutboundDoorBellRegister
4159 bool AcknowledgeInterrupt:1;
4163 bool StatusAvailable:1;
4167 DAC960_PD_OutboundDoorBellRegister_T;
4174 typedef union DAC960_PD_InterruptEnableRegister
4178 bool EnableInterrupts:1;
4182 DAC960_PD_InterruptEnableRegister_T;
4189 typedef union DAC960_PD_ErrorStatusRegister
4194 bool ErrorStatusPending:1;
4198 DAC960_PD_ErrorStatusRegister_T;
4207 void DAC960_PD_NewCommand(
void __iomem *ControllerBaseAddress)
4209 DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister;
4210 InboundDoorBellRegister.All = 0;
4211 InboundDoorBellRegister.Write.NewCommand =
true;
4212 writeb(InboundDoorBellRegister.All,
4213 ControllerBaseAddress + DAC960_PD_InboundDoorBellRegisterOffset);
4217 void DAC960_PD_AcknowledgeStatus(
void __iomem *ControllerBaseAddress)
4219 DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister;
4220 InboundDoorBellRegister.All = 0;
4221 InboundDoorBellRegister.Write.AcknowledgeStatus =
true;
4222 writeb(InboundDoorBellRegister.All,
4223 ControllerBaseAddress + DAC960_PD_InboundDoorBellRegisterOffset);
4227 void DAC960_PD_GenerateInterrupt(
void __iomem *ControllerBaseAddress)
4229 DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister;
4230 InboundDoorBellRegister.All = 0;
4231 InboundDoorBellRegister.Write.GenerateInterrupt =
true;
4232 writeb(InboundDoorBellRegister.All,
4233 ControllerBaseAddress + DAC960_PD_InboundDoorBellRegisterOffset);
4237 void DAC960_PD_ControllerReset(
void __iomem *ControllerBaseAddress)
4239 DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister;
4240 InboundDoorBellRegister.All = 0;
4241 InboundDoorBellRegister.Write.ControllerReset =
true;
4242 writeb(InboundDoorBellRegister.All,
4243 ControllerBaseAddress + DAC960_PD_InboundDoorBellRegisterOffset);
4247 bool DAC960_PD_MailboxFullP(
void __iomem *ControllerBaseAddress)
4249 DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister;
4250 InboundDoorBellRegister.All =
4251 readb(ControllerBaseAddress + DAC960_PD_InboundDoorBellRegisterOffset);
4252 return InboundDoorBellRegister.Read.MailboxFull;
4256 bool DAC960_PD_InitializationInProgressP(
void __iomem *ControllerBaseAddress)
4258 DAC960_PD_InboundDoorBellRegister_T InboundDoorBellRegister;
4259 InboundDoorBellRegister.All =
4260 readb(ControllerBaseAddress + DAC960_PD_InboundDoorBellRegisterOffset);
4261 return InboundDoorBellRegister.Read.InitializationInProgress;
4265 void DAC960_PD_AcknowledgeInterrupt(
void __iomem *ControllerBaseAddress)
4267 DAC960_PD_OutboundDoorBellRegister_T OutboundDoorBellRegister;
4268 OutboundDoorBellRegister.All = 0;
4269 OutboundDoorBellRegister.Write.AcknowledgeInterrupt =
true;
4270 writeb(OutboundDoorBellRegister.All,
4271 ControllerBaseAddress + DAC960_PD_OutboundDoorBellRegisterOffset);
4275 bool DAC960_PD_StatusAvailableP(
void __iomem *ControllerBaseAddress)
4277 DAC960_PD_OutboundDoorBellRegister_T OutboundDoorBellRegister;
4278 OutboundDoorBellRegister.All =
4279 readb(ControllerBaseAddress + DAC960_PD_OutboundDoorBellRegisterOffset);
4280 return OutboundDoorBellRegister.Read.StatusAvailable;
4284 void DAC960_PD_EnableInterrupts(
void __iomem *ControllerBaseAddress)
4286 DAC960_PD_InterruptEnableRegister_T InterruptEnableRegister;
4287 InterruptEnableRegister.All = 0;
4288 InterruptEnableRegister.Bits.EnableInterrupts =
true;
4289 writeb(InterruptEnableRegister.All,
4290 ControllerBaseAddress + DAC960_PD_InterruptEnableRegisterOffset);
4294 void DAC960_PD_DisableInterrupts(
void __iomem *ControllerBaseAddress)
4296 DAC960_PD_InterruptEnableRegister_T InterruptEnableRegister;
4297 InterruptEnableRegister.All = 0;
4298 InterruptEnableRegister.Bits.EnableInterrupts =
false;
4299 writeb(InterruptEnableRegister.All,
4300 ControllerBaseAddress + DAC960_PD_InterruptEnableRegisterOffset);
4304 bool DAC960_PD_InterruptsEnabledP(
void __iomem *ControllerBaseAddress)
4306 DAC960_PD_InterruptEnableRegister_T InterruptEnableRegister;
4307 InterruptEnableRegister.All =
4308 readb(ControllerBaseAddress + DAC960_PD_InterruptEnableRegisterOffset);
4309 return InterruptEnableRegister.Bits.EnableInterrupts;
4313 void DAC960_PD_WriteCommandMailbox(
void __iomem *ControllerBaseAddress,
4317 ControllerBaseAddress + DAC960_PD_CommandOpcodeRegisterOffset);
4319 ControllerBaseAddress + DAC960_PD_MailboxRegister4Offset);
4321 ControllerBaseAddress + DAC960_PD_MailboxRegister8Offset);
4323 ControllerBaseAddress + DAC960_PD_MailboxRegister12Offset);
4326 static inline DAC960_V1_CommandIdentifier_T
4327 DAC960_PD_ReadStatusCommandIdentifier(
void __iomem *ControllerBaseAddress)
4329 return readb(ControllerBaseAddress
4330 + DAC960_PD_StatusCommandIdentifierRegOffset);
4333 static inline DAC960_V1_CommandStatus_T
4334 DAC960_PD_ReadStatusRegister(
void __iomem *ControllerBaseAddress)
4336 return readw(ControllerBaseAddress + DAC960_PD_StatusRegisterOffset);
4340 DAC960_PD_ReadErrorStatus(
void __iomem *ControllerBaseAddress,
4341 unsigned char *ErrorStatus,
4342 unsigned char *Parameter0,
4343 unsigned char *Parameter1)
4345 DAC960_PD_ErrorStatusRegister_T ErrorStatusRegister;
4346 ErrorStatusRegister.All =
4347 readb(ControllerBaseAddress + DAC960_PD_ErrorStatusRegisterOffset);
4348 if (!ErrorStatusRegister.Bits.ErrorStatusPending)
return false;
4349 ErrorStatusRegister.Bits.ErrorStatusPending =
false;
4350 *ErrorStatus = ErrorStatusRegister.All;
4352 readb(ControllerBaseAddress + DAC960_PD_CommandOpcodeRegisterOffset);
4354 readb(ControllerBaseAddress + DAC960_PD_CommandIdentifierRegisterOffset);
4355 writeb(0, ControllerBaseAddress + DAC960_PD_ErrorStatusRegisterOffset);
4359 static inline void DAC960_P_To_PD_TranslateEnquiry(
void *Enquiry)
4361 memcpy(Enquiry + 132, Enquiry + 36, 64);
4362 memset(Enquiry + 36, 0, 96);
4365 static inline void DAC960_P_To_PD_TranslateDeviceState(
void *
DeviceState)
4367 memcpy(DeviceState + 2, DeviceState + 3, 1);
4368 memmove(DeviceState + 4, DeviceState + 5, 2);
4369 memmove(DeviceState + 6, DeviceState + 8, 4);
4377 CommandMailbox->
Bytes[3] &= 0x7;
4378 CommandMailbox->
Bytes[3] |= CommandMailbox->
Bytes[7] << 6;
4387 CommandMailbox->
Bytes[7] = CommandMailbox->
Bytes[3] >> 6;
4388 CommandMailbox->
Bytes[3] &= 0x7;
4389 CommandMailbox->
Bytes[3] |= LogicalDriveNumber << 3;
4397 static void DAC960_FinalizeController(DAC960_Controller_T *);
4398 static void DAC960_V1_QueueReadWriteCommand(DAC960_Command_T *);
4399 static void DAC960_V2_QueueReadWriteCommand(DAC960_Command_T *);
4401 static irqreturn_t DAC960_BA_InterruptHandler(
int,
void *);
4402 static irqreturn_t DAC960_LP_InterruptHandler(
int,
void *);
4403 static irqreturn_t DAC960_LA_InterruptHandler(
int,
void *);
4404 static irqreturn_t DAC960_PG_InterruptHandler(
int,
void *);
4405 static irqreturn_t DAC960_PD_InterruptHandler(
int,
void *);
4406 static irqreturn_t DAC960_P_InterruptHandler(
int,
void *);
4407 static void DAC960_V1_QueueMonitoringCommand(DAC960_Command_T *);
4408 static void DAC960_V2_QueueMonitoringCommand(DAC960_Command_T *);
4409 static void DAC960_MonitoringTimerFunction(
unsigned long);
4410 static void DAC960_Message(DAC960_MessageLevel_T,
unsigned char *,
4411 DAC960_Controller_T *, ...);
4412 static void DAC960_CreateProcEntries(DAC960_Controller_T *);
4413 static void DAC960_DestroyProcEntries(DAC960_Controller_T *);