buslogic958.h

来自「ReactOS是一些高手根据Windows XP的内核编写出的类XP。内核实现机」· C头文件 代码 · 共 1,187 行 · 第 1/4 页

H
1,187
字号
  UCHAR HostAdapterID:4;    /* Byte 2 Bits 0-3 */
  UCHAR :4;                 /* Byte 2 Bits 4-7 */
}BusLogic_Configuration_T;

//  Define the Inquire Setup Information reply structure.
typedef struct BusLogic_SynchronousValue
{
  UCHAR Offset:4;               /* Bits 0-3 */
  UCHAR TransferPeriod:3;       /* Bits 4-6 */
  BOOLEAN Synchronous:1;        /* Bit 7    */
}BusLogic_SynchronousValue_T;

typedef BusLogic_SynchronousValue_T
  BusLogic_SynchronousValues8_T[8];

typedef struct BusLogic_SetupInformation
{
  BOOLEAN SynchronousInitiationEnabled:1;                /* Byte 0 Bit 0 */
  BOOLEAN ParityCheckingEnabled:1;                       /* Byte 0 Bit 1 */
  UCHAR :6;                                              /* Byte 0 Bits 2-7 */
  UCHAR BusTransferRate;                                 /* Byte 1 */
  UCHAR PreemptTimeOnBus;                                /* Byte 2 */
  UCHAR TimeOffBus;                                      /* Byte 3 */
  UCHAR MailboxCount;                                    /* Byte 4 */
  UCHAR MailboxAddress[3];                               /* Bytes 5-7 */
  BusLogic_SynchronousValues8_T SynchronousValuesID0to7; /* Bytes 8-15 */
  UCHAR DisconnectPermittedID0to7;                       /* Byte 16 */
  UCHAR Signature;                                       /* Byte 17 */
  UCHAR CharacterD;                                      /* Byte 18 */
  UCHAR HostBusType;                                     /* Byte 19 */
  UCHAR WideTransfersPermittedID0to7;                    /* Byte 20 */
  UCHAR WideTransfersActiveID0to7;                       /* Byte 21 */
  BusLogic_SynchronousValues8_T SynchronousValuesID8to15;/* Bytes 22-29 */
  UCHAR DisconnectPermittedID8to15;                      /* Byte 30 */
  UCHAR :8;                                              /* Byte 31 */
  UCHAR WideTransfersPermittedID8to15;                   /* Byte 32 */
  UCHAR WideTransfersActiveID8to15;                      /* Byte 33 */
}BusLogic_SetupInformation_T;

// Something has to be done about the packing machanism of these structures - Namita
// Define the Inquire Extended Setup Information reply structure.
typedef struct BusLogic_ExtendedSetupInformation
{
  UCHAR BusType;                            // Byte 0    
  UCHAR BIOS_Address;                       // Byte 1    
  unsigned short ScatterGatherLimit;        // Bytes 2-3 
  UCHAR MailboxCount;                       // Byte 4 
  BusLogic_BusAddress_T BaseMailboxAddress; // Bytes 5-8 
  struct
  {
      UCHAR :2;                             // Byte 9 Bits 0-1 
      BOOLEAN FastOnEISA:1;                 // Byte 9 Bit 2 
      UCHAR :3;                             // Byte 9 Bits 3-5 
      BOOLEAN LevelSensitiveInterrupt:1;    // Byte 9 Bit 6 
      UCHAR :1; 
  } Misc;                                   // Byte 9 Bit 7 
  UCHAR FirmwareRevision[3];                // Bytes 10-12 
  BOOLEAN HostWideSCSI:1;                   // Byte 13 Bit 0 
  BOOLEAN HostDifferentialSCSI:1;           // Byte 13 Bit 1 
  BOOLEAN HostSupportsSCAM:1;               // Byte 13 Bit 2 
  BOOLEAN HostUltraSCSI:1;                  // Byte 13 Bit 3 
  BOOLEAN HostSmartTermination:1;           // Byte 13 Bit 4 
  UCHAR :3;                                 // Byte 13 Bits 5-7 
}BusLogic_ExtendedSetupInformation_T;

//  Define the Host Adapter Local RAM AutoSCSI structure.
typedef struct BusLogic_AutoSCSIData
{
  UCHAR InternalFactorySignature[2];/* Bytes 0-1 */
  UCHAR InformationByteCount;       /* Byte 2 */
  UCHAR HostAdapterType[6];         /* Bytes 3-8 */
  UCHAR :8;                         /* Byte 9 */
  UCHAR FloppyEnabled:1;            /* Byte 10 Bit 0 */
  UCHAR FloppySecondary:1;          /* Byte 10 Bit 1 */
  UCHAR LevelSensitiveInterrupt:1;  /* Byte 10 Bit 2 */
  UCHAR :2;                         /* Byte 10 Bits 3-4 */
  UCHAR SystemRAMAreaForBIOS:3;     /* Byte 10 Bits 5-7 */
  UCHAR DMA_Channel:7;              /* Byte 11 Bits 0-6 */
  UCHAR DMA_AutoConfiguration:1;    /* Byte 11 Bit 7 */
  UCHAR IRQ_Channel:7;              /* Byte 12 Bits 0-6 */
  UCHAR IRQ_AutoConfiguration:1;    /* Byte 12 Bit 7 */
  UCHAR DMA_TransferRate;           /* Byte 13 */
  UCHAR SCSI_ID;                    /* Byte 14 */
  UCHAR LowByteTerminated:1;                 /* Byte 15 Bit 0 */
  UCHAR ParityCheckingEnabled:1;             /* Byte 15 Bit 1 */
  UCHAR HighByteTerminated:1;                /* Byte 15 Bit 2 */
  UCHAR NoisyCablingEnvironment:1;           /* Byte 15 Bit 3 */
  UCHAR FastSynchronousNegotiation:1;        /* Byte 15 Bit 4 */
  UCHAR BusResetEnabled:1;                   /* Byte 15 Bit 5 */
  UCHAR :1;                                  /* Byte 15 Bit 6 */
  UCHAR ActiveNegationEnabled:1;             /* Byte 15 Bit 7 */
  UCHAR BusOnDelay;                          /* Byte 16 */
  UCHAR BusOffDelay;                         /* Byte 17 */
  UCHAR HostAdapterBIOSEnabled:1;            /* Byte 18 Bit 0 */
  UCHAR BIOSRedirectionOfINT19Enabled:1;     /* Byte 18 Bit 1 */
  UCHAR ExtendedTranslationEnabled:1;        /* Byte 18 Bit 2 */
  UCHAR MapRemovableAsFixedEnabled:1;        /* Byte 18 Bit 3 */
  UCHAR :1;                                  /* Byte 18 Bit 4 */
  UCHAR BIOSSupportsMoreThan2DrivesEnabled:1;/* Byte 18 Bit 5 */
  UCHAR BIOSInterruptModeEnabled:1;          /* Byte 18 Bit 6 */
  UCHAR FlopticalSupportEnabled:1;           /* Byte 19 Bit 7 */
  unsigned short DeviceEnabled:16;           /* Bytes 19-20 */
  unsigned short WidePermitted:16;           /* Bytes 21-22 */
  unsigned short FastPermitted:16;           /* Bytes 23-24 */
  unsigned short SynchronousPermitted:16;    /* Bytes 25-26 */
  unsigned short DisconnectPermitted:16;     /* Bytes 27-28 */
  unsigned short SendStartUnitCommand:16;    /* Bytes 29-30 */
  unsigned short IgnoreInBIOSScan:16;        /* Bytes 31-32 */
  UCHAR PCIInterruptPin:2;                   /* Byte 33 Bits 0-1 */
  UCHAR HostAdapterIOPortAddress:2;          /* Byte 33 Bits 2-3 */
  UCHAR StrictRoundRobinModeEnabled:1;       /* Byte 33 Bit 4 */
  UCHAR VESABusSpeedGreaterThan33MHz:1;      /* Byte 33 Bit 5 */
  UCHAR VESABurstWriteEnabled:1;             /* Byte 33 Bit 6 */
  UCHAR VESABurstReadEnabled:1;              /* Byte 33 Bit 7 */
  unsigned short UltraPermitted:16;          /* Bytes 34-35 */
  unsigned int :32;                          /* Bytes 36-39 */
  UCHAR :8;                                  /* Byte 40 */
  UCHAR AutoSCSIMaximumLUN;                  /* Byte 41 */
  UCHAR :1;                                  /* Byte 42 Bit 0 */
  UCHAR SCAM_Dominant:1;                     /* Byte 42 Bit 1 */
  UCHAR SCAM_Enabled:1;                      /* Byte 42 Bit 2 */
  UCHAR SCAM_Level2:1;                       /* Byte 42 Bit 3 */
  UCHAR :4;                                  /* Byte 42 Bits 4-7 */
  UCHAR INT13ExtensionEnabled:1;             /* Byte 43 Bit 0 */
  UCHAR :1;                                  /* Byte 43 Bit 1 */
  UCHAR CDROMBootEnabled:1;                  /* Byte 43 Bit 2 */
  UCHAR :5;                                  /* Byte 43 Bits 3-7 */
  UCHAR BootTargetID:4;                      /* Byte 44 Bits 0-3 */
  UCHAR BootChannel:4;                       /* Byte 44 Bits 4-7 */
  UCHAR ForceBusDeviceScanningOrder:1;       /* Byte 45 Bit 0 */
  UCHAR :7;                                  /* Byte 45 Bits 1-7 */
  unsigned short NonTaggedToAlternateLUNPermitted;   /* Bytes 46-47 */
  unsigned short RenegotiateSyncAfterCheckCondition; /* Bytes 48-49 */
  UCHAR Reserved[10];                        /* Bytes 50-59 */
  UCHAR ManufacturingDiagnostic[2];          /* Bytes 60-61 */
  unsigned short Checksum:16;                /* Bytes 62-63 */
}BusLogic_AutoSCSIData_T;
#pragma pack()

//  Define the Outgoing Mailbox Action Codes.
typedef enum
{
  BusLogic_OutgoingMailboxFree =        0x00,
  BusLogic_MailboxStartCommand =        0x01,
  BusLogic_MailboxAbortCommand =        0x02
}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
}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
}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
}BusLogic_HostAdapterStatus_T;

//  Define the SCSI Target Device Status Codes.
typedef enum
{
  BusLogic_OperationGood =          0x00,
  BusLogic_CheckCondition =         0x02,
  BusLogic_DeviceBusy =             0x08
}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 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;


typedef UCHAR SCSI_CDB_T[BusLogic_CDB_MaxLength];

//  Define the Driver CCB Status Codes.
typedef enum
{
  BusLogic_CCB_Free =               0,
  BusLogic_CCB_Active =             1,
  BusLogic_CCB_Completed =          2,
  BusLogic_CCB_Reset =              3
}BusLogic_CCB_Status_T;

//  Define the 32 Bit Mode Command Control Block (CCB) structure.  The first 40
//  bytes are defined by the MultiMaster Firmware The remaining components are 
//  defined by the Scsi MiniportDriver.  
//  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.
//  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
{
  UCHAR Opcode;                 /* Byte 0 */
  UCHAR :3;                     /* Byte 1 Bits 0-2 */
  UCHAR DataDirection:2;        /* Byte 1 Bits 3-4 */
  UCHAR TagEnable:1;            /* Byte 1 Bit 5 */
  UCHAR QueueTag:2;             /* Byte 1 Bits 6-7 */
  UCHAR CDB_Length;             /* Byte 2 */
  UCHAR SenseDataLength;        /* Byte 3 */
  BusLogic_ByteCount_T DataLength;  /* Bytes 4-7 */
  BusLogic_BusAddress_T DataPointer;/* Bytes 8-11 */
  UCHAR :8;                         /* Byte 12 */
  UCHAR :8;                         /* Byte 13 */
  UCHAR HostAdapterStatus;          /* Byte 14 */
  UCHAR TargetDeviceStatus;         /* Byte 15 */
  UCHAR TargetID;                   /* Byte 16 */
  UCHAR LogicalUnit:5;              /* Byte 17 Bits 0-4 */
  UCHAR LegacyTagEnable:1;          /* Byte 17 Bit 5 */
  UCHAR LegacyQueueTag:2;           /* Byte 17 Bits 6-7 */
  SCSI_CDB_T CDB;                   /* Bytes 18-29 */
  UCHAR :8;                         /* Byte 30 */
  UCHAR :8;                         /* Byte 31 */
  unsigned int :32;                 /* Bytes 32-35 */
  BusLogic_BusAddress_T SenseDataPointer;/* Bytes 36-39 */

  // BusLogic Driver Defined Portion.
  BusLogic_CCB_Status_T Status;
  unsigned long SerialNumber;
  struct BusLogic_HostAdapter *HostAdapter;
  struct BusLogic_CCB *Next;
    BusLogic_ScatterGatherSegment_T ScatterGatherList[BusLogic_ScatterGatherLimit];

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?