?? buslogic.h
字號:
/* Define the Host Adapter Local RAM Auto SCSI Byte 45 structure.*/typedef struct BusLogic_AutoSCSIByte45{ unsigned char ForceBusDeviceScanningOrder:1; /* Bit 0 */ unsigned char :7; /* Bits 1-7 */}BusLogic_AutoSCSIByte45_T;/* Define the Host Adapter Local RAM BIOS Drive Map Byte structure.*/#define BusLogic_BIOS_DriveMapOffset 17typedef struct BusLogic_BIOSDriveMapByte{ unsigned char TargetIDBit3:1; /* Bit 0 */ unsigned char :2; /* Bits 1-2 */ BusLogic_BIOS_DiskGeometryTranslation_T DiskGeometry:2; /* Bits 3-4 */ unsigned char TargetID:3; /* Bits 5-7 */}BusLogic_BIOSDriveMapByte_T;/* Define the Modify I/O Address request type. On PCI Host Adapters, the Modify I/O Address command allows modification of the ISA compatible I/O Address that the Host Adapter responds to; it does not affect the PCI compliant I/O Address assigned at system initialization.*/typedef BusLogic_ISACompatibleIOPort_T BusLogic_ModifyIOAddressRequest_T;/* Define the Set CCB Format request type. Extended LUN Format CCBs are necessary to support more than 8 Logical Units per Target Device.*/typedef enum BusLogic_SetCCBFormatRequest{ BusLogic_LegacyLUNFormatCCB = 0, BusLogic_ExtendedLUNFormatCCB = 1}__attribute__ ((packed))BusLogic_SetCCBFormatRequest_T;/* Define the Requested Reply Length type used by the Inquire Setup Information, Inquire Host Adapter Model Number, Inquire Synchronous Period, and Inquire Extended Setup Information commands.*/typedef unsigned char BusLogic_RequestedReplyLength_T;/* Define the Outgoing Mailbox Action Codes.*/typedef enum{ BusLogic_OutgoingMailboxFree = 0x00, BusLogic_MailboxStartCommand = 0x01, BusLogic_MailboxAbortCommand = 0x02}__attribute__ ((packed))BusLogic_ActionCode_T;/* Define the Incoming Mailbox Completion Codes. The MultiMaster Firmware only uses codes 0 - 4. The FlashPoint SCCB Manager has no mailboxes, so completion codes are stored in the CCB; it only uses codes 1, 2, 4, and 5.*/typedef enum{ BusLogic_IncomingMailboxFree = 0x00, BusLogic_CommandCompletedWithoutError = 0x01, BusLogic_CommandAbortedAtHostRequest = 0x02, BusLogic_AbortedCommandNotFound = 0x03, BusLogic_CommandCompletedWithError = 0x04, BusLogic_InvalidCCB = 0x05}__attribute__ ((packed))BusLogic_CompletionCode_T;/* Define the Command Control Block (CCB) Opcodes.*/typedef enum{ BusLogic_InitiatorCCB = 0x00, BusLogic_TargetCCB = 0x01, BusLogic_InitiatorCCB_ScatterGather = 0x02, BusLogic_InitiatorCCB_ResidualDataLength = 0x03, BusLogic_InitiatorCCB_ScatterGatherResidual = 0x04, BusLogic_BusDeviceReset = 0x81}__attribute__ ((packed))BusLogic_CCB_Opcode_T;/* Define the CCB Data Direction Codes.*/typedef enum{ BusLogic_UncheckedDataTransfer = 0, BusLogic_DataInLengthChecked = 1, BusLogic_DataOutLengthChecked = 2, BusLogic_NoDataTransfer = 3}BusLogic_DataDirection_T;/* Define the Host Adapter Status Codes. The MultiMaster Firmware does not return status code 0x0C; it uses 0x12 for both overruns and underruns.*/typedef enum{ BusLogic_CommandCompletedNormally = 0x00, BusLogic_LinkedCommandCompleted = 0x0A, BusLogic_LinkedCommandCompletedWithFlag = 0x0B, BusLogic_DataUnderRun = 0x0C, BusLogic_SCSISelectionTimeout = 0x11, BusLogic_DataOverRun = 0x12, BusLogic_UnexpectedBusFree = 0x13, BusLogic_InvalidBusPhaseRequested = 0x14, BusLogic_InvalidOutgoingMailboxActionCode = 0x15, BusLogic_InvalidCommandOperationCode = 0x16, BusLogic_LinkedCCBhasInvalidLUN = 0x17, BusLogic_InvalidCommandParameter = 0x1A, BusLogic_AutoRequestSenseFailed = 0x1B, BusLogic_TaggedQueuingMessageRejected = 0x1C, BusLogic_UnsupportedMessageReceived = 0x1D, BusLogic_HostAdapterHardwareFailed = 0x20, BusLogic_TargetFailedResponseToATN = 0x21, BusLogic_HostAdapterAssertedRST = 0x22, BusLogic_OtherDeviceAssertedRST = 0x23, BusLogic_TargetDeviceReconnectedImproperly = 0x24, BusLogic_HostAdapterAssertedBusDeviceReset = 0x25, BusLogic_AbortQueueGenerated = 0x26, BusLogic_HostAdapterSoftwareError = 0x27, BusLogic_HostAdapterHardwareTimeoutError = 0x30, BusLogic_SCSIParityErrorDetected = 0x34}__attribute__ ((packed))BusLogic_HostAdapterStatus_T;/* Define the SCSI Target Device Status Codes.*/typedef enum{ BusLogic_OperationGood = 0x00, BusLogic_CheckCondition = 0x02, BusLogic_DeviceBusy = 0x08}__attribute__ ((packed))BusLogic_TargetDeviceStatus_T;/* Define the Queue Tag Codes.*/typedef enum{ BusLogic_SimpleQueueTag = 0, BusLogic_HeadOfQueueTag = 1, BusLogic_OrderedQueueTag = 2, BusLogic_ReservedQT = 3}BusLogic_QueueTag_T;/* Define the SCSI Command Descriptor Block (CDB).*/#define BusLogic_CDB_MaxLength 12typedef unsigned char SCSI_CDB_T[BusLogic_CDB_MaxLength];/* Define the Scatter/Gather Segment structure required by the MultiMaster Firmware Interface and the FlashPoint SCCB Manager.*/typedef struct BusLogic_ScatterGatherSegment{ BusLogic_ByteCount_T SegmentByteCount; /* Bytes 0-3 */ BusLogic_BusAddress_T SegmentDataPointer; /* Bytes 4-7 */}BusLogic_ScatterGatherSegment_T;/* Define the Driver CCB Status Codes.*/typedef enum{ BusLogic_CCB_Free = 0, BusLogic_CCB_Active = 1, BusLogic_CCB_Completed = 2, BusLogic_CCB_Reset = 3}__attribute__ ((packed))BusLogic_CCB_Status_T;/* Define the 32 Bit Mode Command Control Block (CCB) structure. The first 40 bytes are defined by and common to both the MultiMaster Firmware and the FlashPoint SCCB Manager. The next 60 bytes are defined by the FlashPoint SCCB Manager. The remaining components are defined by the Linux BusLogic Driver. Extended LUN Format CCBs differ from Legacy LUN Format 32 Bit Mode CCBs only in having the TagEnable and QueueTag fields moved from byte 17 to byte 1, and the Logical Unit field in byte 17 expanded to 6 bits. In theory, Extended LUN Format CCBs can support up to 64 Logical Units, but in practice many devices will respond improperly to Logical Units between 32 and 63, and the SCSI-2 specification defines Bit 5 as LUNTAR. Extended LUN Format CCBs are used by recent versions of the MultiMaster Firmware, as well as by the FlashPoint SCCB Manager; the FlashPoint SCCB Manager only supports 32 Logical Units. Since 64 Logical Units are unlikely to be needed in practice, and since they are problematic for the above reasons, and since limiting them to 5 bits simplifies the CCB structure definition, this driver only supports 32 Logical Units per Target Device.*/typedef struct BusLogic_CCB{ /* MultiMaster Firmware and FlashPoint SCCB Manager Common Portion. */ BusLogic_CCB_Opcode_T Opcode; /* Byte 0 */ unsigned char :3; /* Byte 1 Bits 0-2 */ BusLogic_DataDirection_T DataDirection:2; /* Byte 1 Bits 3-4 */ boolean TagEnable:1; /* Byte 1 Bit 5 */ BusLogic_QueueTag_T QueueTag:2; /* Byte 1 Bits 6-7 */ unsigned char CDB_Length; /* Byte 2 */ unsigned char SenseDataLength; /* Byte 3 */ BusLogic_ByteCount_T DataLength; /* Bytes 4-7 */ BusLogic_BusAddress_T DataPointer; /* Bytes 8-11 */ unsigned char :8; /* Byte 12 */ unsigned char :8; /* Byte 13 */ BusLogic_HostAdapterStatus_T HostAdapterStatus; /* Byte 14 */ BusLogic_TargetDeviceStatus_T TargetDeviceStatus; /* Byte 15 */ unsigned char TargetID; /* Byte 16 */ unsigned char LogicalUnit:5; /* Byte 17 Bits 0-4 */ boolean LegacyTagEnable:1; /* Byte 17 Bit 5 */ BusLogic_QueueTag_T LegacyQueueTag:2; /* Byte 17 Bits 6-7 */ SCSI_CDB_T CDB; /* Bytes 18-29 */ unsigned char :8; /* Byte 30 */ unsigned char :8; /* Byte 31 */ unsigned int :32; /* Bytes 32-35 */ BusLogic_BusAddress_T SenseDataPointer; /* Bytes 36-39 */ /* FlashPoint SCCB Manager Defined Portion. */ void (*CallbackFunction)(struct BusLogic_CCB *); /* Bytes 40-43 */ BusLogic_Base_Address_T BaseAddress; /* Bytes 44-47 */ BusLogic_CompletionCode_T CompletionCode; /* Byte 48 */#ifndef CONFIG_SCSI_OMIT_FLASHPOINT unsigned char :8; /* Byte 49 */ unsigned short OS_Flags; /* Bytes 50-51 */ unsigned char Private[48]; /* Bytes 52-99 */#endif /* BusLogic Linux Driver Defined Portion. */ boolean AllocationGroupHead; BusLogic_CCB_Status_T Status; unsigned long SerialNumber; SCSI_Command_T *Command; struct BusLogic_HostAdapter *HostAdapter; struct BusLogic_CCB *Next; struct BusLogic_CCB *NextAll; BusLogic_ScatterGatherSegment_T ScatterGatherList[BusLogic_ScatterGatherLimit];}BusLogic_CCB_T;/* Define the 32 Bit Mode Outgoing Mailbox structure.*/typedef struct BusLogic_OutgoingMailbox{ BusLogic_BusAddress_T CCB; /* Bytes 0-3 */ unsigned int :24; /* Bytes 4-6 */ BusLogic_ActionCode_T ActionCode; /* Byte 7 */}BusLogic_OutgoingMailbox_T;/* Define the 32 Bit Mode Incoming Mailbox structure.*/typedef struct BusLogic_IncomingMailbox{ BusLogic_BusAddress_T CCB; /* Bytes 0-3 */ BusLogic_HostAdapterStatus_T HostAdapterStatus; /* Byte 4 */ BusLogic_TargetDeviceStatus_T TargetDeviceStatus; /* Byte 5 */ unsigned char :8; /* Byte 6 */ BusLogic_CompletionCode_T CompletionCode; /* Byte 7 */}BusLogic_IncomingMailbox_T;/* Define the BusLogic Driver Options structure.*/typedef struct BusLogic_DriverOptions{ unsigned short TaggedQueuingPermitted; unsigned short TaggedQueuingPermittedMask; unsigned short BusSettleTime; BusLogic_LocalOptions_T LocalOptions; unsigned char CommonQueueDepth; unsigned char QueueDepth[BusLogic_MaxTargetDevices]; BusLogic_ErrorRecoveryStrategy_T ErrorRecoveryStrategy[BusLogic_MaxTargetDevices];}BusLogic_DriverOptions_T;/* Define the Host Adapter Target Flags structure.*/typedef struct BusLogic_TargetFlags{ boolean TargetExists:1; boolean TaggedQueuingSupported:1; boolean WideTransfersSupported:1; boolean TaggedQueuingActive:1; boolean WideTransfersActive:1; boolean CommandSuccessfulFlag:1; boolean TargetInfoReported:1;}BusLogic_TargetFlags_T;/* Define the Host Adapter Target Statistics structure.*/#define BusLogic_SizeBuckets 10typedef unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets];typedef struct BusLogic_TargetStatistics{ unsigned int CommandsAttempted; unsigned int CommandsCompleted; unsigned int ReadCommands; unsigned int WriteCommands; BusLogic_ByteCounter_T TotalBytesRead; BusLogic_ByteCounter_T TotalBytesWritten; BusLogic_CommandSizeBuckets_T ReadCommandSizeBuckets; BusLogic_CommandSizeBuckets_T WriteCommandSizeBuckets; unsigned short CommandAbortsRequested; unsigned short CommandAbortsAttempted; unsigned short CommandAbortsCompleted; unsigned short BusDeviceResetsRequested; unsigned short BusDeviceResetsAttempted; unsigned short BusDeviceResetsCompleted; unsigned short HostAdapterResetsRequested; unsigned short HostAdapterResetsAttempted; unsigned short HostAdapterResetsCompleted;}BusLogic_TargetStatistics_T;/* Define the FlashPoint Card Handle data type.*/#define FlashPoint_BadCardHandle 0xFFFFFFFFtypedef unsigned int FlashPoint_CardHandle_T;/* Define the FlashPoint Information structure. This structure is defined by the FlashPoint SCCB Manager.*/typedef struct FlashPoint_Info{ BusLogic_Base_Address_T BaseAddress; /* Bytes 0-3 */ boolean Present; /* Byte 4 */ unsigned char IRQ_Channel; /* Byte 5 */ unsigned char SCSI_ID; /* Byte 6 */ unsigned char SCSI_LUN; /* Byte 7 */ unsigned short FirmwareRevision; /* Bytes 8-9 */ unsigned short SynchronousPermitted; /* Bytes 10-11 */ unsigned short FastPermitted; /* Bytes 12-13 */ unsigned short UltraPermitted; /* Bytes 14-15 */ unsigned short DisconnectPermitted; /* Bytes 16-17 */ unsigned short WidePermitted; /* Bytes 18-19 */ boolean ParityCheckingEnabled:1; /* Byte 20 Bit 0 */ boolean HostWideSCSI:1; /* Byte 20 Bit 1 */ boolean HostSoftReset:1; /* Byte 20 Bit 2 */ boolean ExtendedTranslationEnabled:1; /* Byte 20 Bit 3 */ boolean LowByteTerminated:1; /* Byte 20 Bit 4 */ boolean HighByteTerminated:1; /* Byte 20 Bit 5 */ boolean ReportDataUnderrun:1; /* Byte 20 Bit 6 */ boolean SCAM_Enabled:1; /* Byte 20 Bit 7 */ boolean SCAM_Level2:1; /* Byte 21 Bit 0 */ unsigned char :7; /* Byte 21 Bits 1-7 */ unsigned char Family; /* Byte 22 */ unsigned char BusType; /* Byte 23 */ unsigned char ModelNumber[3]; /* Bytes 24-26 */ unsigned char RelativeCardNumber; /* Byte 27 */ unsigned char Reserved[4]; /* Bytes 28-31 */ unsigned int OS_Reserved; /* Bytes 32-35 */ unsigned char TranslationInfo[4]; /* Bytes 36-39 */ unsigned int Reserved2[5]; /* Bytes 40-59 */ unsigned int SecondaryRange; /* Bytes 60-63 */}FlashPoint_Info_T;/* Define the BusLogic Driver Host Adapter structure.*/typedef struct BusLogic_HostAdapter{ SCSI_Host_T *SCSI_Host; BusLogic_HostAdapterType_T HostAdapterType;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -