Commit 0596d1c6 authored by Linus Torvalds's avatar Linus Torvalds

Run 'indent' on BusLogic driver to keep Alan sane.

He got the "privilege" of cleaning the driver up, and
to keep everybody happy, indent it sanely first.

This is the result of:

        indent -kr -i8 -bri0 -l255 BusLogic.c BusLogic.h
parent 3c50a000
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -128,17 +128,15 @@ ...@@ -128,17 +128,15 @@
Define the Driver Message Levels. Define the Driver Message Levels.
*/ */
enum BusLogic_MessageLevel enum BusLogic_MessageLevel {
{ BusLogic_AnnounceLevel = 0,
BusLogic_AnnounceLevel = 0, BusLogic_InfoLevel = 1,
BusLogic_InfoLevel = 1, BusLogic_NoticeLevel = 2,
BusLogic_NoticeLevel = 2, BusLogic_WarningLevel = 3,
BusLogic_WarningLevel = 3, BusLogic_ErrorLevel = 4
BusLogic_ErrorLevel = 4
}; };
static char *BusLogic_MessageLevelMap[] = static char *BusLogic_MessageLevelMap[] = { KERN_NOTICE, KERN_NOTICE, KERN_NOTICE, KERN_WARNING, KERN_ERR };
{ KERN_NOTICE, KERN_NOTICE, KERN_NOTICE, KERN_WARNING, KERN_ERR };
/* /*
...@@ -166,17 +164,15 @@ static char *BusLogic_MessageLevelMap[] = ...@@ -166,17 +164,15 @@ static char *BusLogic_MessageLevelMap[] =
of I/O Addresses required by each type. of I/O Addresses required by each type.
*/ */
enum BusLogic_HostAdapterType enum BusLogic_HostAdapterType {
{ BusLogic_MultiMaster = 1,
BusLogic_MultiMaster = 1, BusLogic_FlashPoint = 2
BusLogic_FlashPoint = 2
} PACKED; } PACKED;
#define BusLogic_MultiMasterAddressCount 4 #define BusLogic_MultiMasterAddressCount 4
#define BusLogic_FlashPointAddressCount 256 #define BusLogic_FlashPointAddressCount 256
static int BusLogic_HostAdapterAddressCount[3] = static int BusLogic_HostAdapterAddressCount[3] = { 0, BusLogic_MultiMasterAddressCount, BusLogic_FlashPointAddressCount };
{ 0, BusLogic_MultiMasterAddressCount, BusLogic_FlashPointAddressCount };
/* /*
...@@ -206,39 +202,35 @@ static int BusLogic_HostAdapterAddressCount[3] = ...@@ -206,39 +202,35 @@ static int BusLogic_HostAdapterAddressCount[3] =
Define the possible Host Adapter Bus Types. Define the possible Host Adapter Bus Types.
*/ */
enum BusLogic_HostAdapterBusType enum BusLogic_HostAdapterBusType {
{ BusLogic_Unknown_Bus = 0,
BusLogic_Unknown_Bus = 0, BusLogic_ISA_Bus = 1,
BusLogic_ISA_Bus = 1, BusLogic_EISA_Bus = 2,
BusLogic_EISA_Bus = 2, BusLogic_PCI_Bus = 3,
BusLogic_PCI_Bus = 3, BusLogic_VESA_Bus = 4,
BusLogic_VESA_Bus = 4, BusLogic_MCA_Bus = 5
BusLogic_MCA_Bus = 5
} PACKED; } PACKED;
static char *BusLogic_HostAdapterBusNames[] = static char *BusLogic_HostAdapterBusNames[] = { "Unknown", "ISA", "EISA", "PCI", "VESA", "MCA" };
{ "Unknown", "ISA", "EISA", "PCI", "VESA", "MCA" };
static enum BusLogic_HostAdapterBusType BusLogic_HostAdapterBusTypes[] = static enum BusLogic_HostAdapterBusType BusLogic_HostAdapterBusTypes[] = {
{ BusLogic_VESA_Bus, /* BT-4xx */
BusLogic_VESA_Bus, /* BT-4xx */ BusLogic_ISA_Bus, /* BT-5xx */
BusLogic_ISA_Bus, /* BT-5xx */ BusLogic_MCA_Bus, /* BT-6xx */
BusLogic_MCA_Bus, /* BT-6xx */ BusLogic_EISA_Bus, /* BT-7xx */
BusLogic_EISA_Bus, /* BT-7xx */ BusLogic_Unknown_Bus, /* BT-8xx */
BusLogic_Unknown_Bus, /* BT-8xx */ BusLogic_PCI_Bus /* BT-9xx */
BusLogic_PCI_Bus /* BT-9xx */
}; };
/* /*
Define the possible Host Adapter BIOS Disk Geometry Translations. Define the possible Host Adapter BIOS Disk Geometry Translations.
*/ */
enum BusLogic_BIOS_DiskGeometryTranslation enum BusLogic_BIOS_DiskGeometryTranslation {
{ BusLogic_BIOS_Disk_Not_Installed = 0,
BusLogic_BIOS_Disk_Not_Installed = 0, BusLogic_BIOS_Disk_Installed_64x32 = 1,
BusLogic_BIOS_Disk_Installed_64x32 = 1, BusLogic_BIOS_Disk_Installed_128x32 = 2,
BusLogic_BIOS_Disk_Installed_128x32 = 2, BusLogic_BIOS_Disk_Installed_255x63 = 3
BusLogic_BIOS_Disk_Installed_255x63 = 3
} PACKED; } PACKED;
...@@ -247,18 +239,17 @@ enum BusLogic_BIOS_DiskGeometryTranslation ...@@ -247,18 +239,17 @@ enum BusLogic_BIOS_DiskGeometryTranslation
*/ */
typedef enum { typedef enum {
false, false,
true true
} PACKED boolean; } PACKED boolean;
/* /*
Define a 10^18 Statistics Byte Counter data type. Define a 10^18 Statistics Byte Counter data type.
*/ */
struct BusLogic_ByteCounter struct BusLogic_ByteCounter {
{ unsigned int Units;
unsigned int Units; unsigned int Billions;
unsigned int Billions;
}; };
...@@ -266,58 +257,54 @@ struct BusLogic_ByteCounter ...@@ -266,58 +257,54 @@ struct BusLogic_ByteCounter
Define the structure for I/O Address and Bus Probing Information. Define the structure for I/O Address and Bus Probing Information.
*/ */
struct BusLogic_ProbeInfo struct BusLogic_ProbeInfo {
{ enum BusLogic_HostAdapterType HostAdapterType;
enum BusLogic_HostAdapterType HostAdapterType; enum BusLogic_HostAdapterBusType HostAdapterBusType;
enum BusLogic_HostAdapterBusType HostAdapterBusType; unsigned long IO_Address;
unsigned long IO_Address; unsigned long PCI_Address;
unsigned long PCI_Address; struct pci_dev *PCI_Device;
struct pci_dev *PCI_Device; unsigned char Bus;
unsigned char Bus; unsigned char Device;
unsigned char Device; unsigned char IRQ_Channel;
unsigned char IRQ_Channel;
}; };
/* /*
Define the Probe Options. Define the Probe Options.
*/ */
struct BusLogic_ProbeOptions struct BusLogic_ProbeOptions {
{ boolean NoProbe:1; /* Bit 0 */
boolean NoProbe:1; /* Bit 0 */ boolean NoProbeISA:1; /* Bit 1 */
boolean NoProbeISA:1; /* Bit 1 */ boolean NoProbePCI:1; /* Bit 2 */
boolean NoProbePCI:1; /* Bit 2 */ boolean NoSortPCI:1; /* Bit 3 */
boolean NoSortPCI:1; /* Bit 3 */ boolean MultiMasterFirst:1; /* Bit 4 */
boolean MultiMasterFirst:1; /* Bit 4 */ boolean FlashPointFirst:1; /* Bit 5 */
boolean FlashPointFirst:1; /* Bit 5 */ boolean LimitedProbeISA:1; /* Bit 6 */
boolean LimitedProbeISA:1; /* Bit 6 */ boolean Probe330:1; /* Bit 7 */
boolean Probe330:1; /* Bit 7 */ boolean Probe334:1; /* Bit 8 */
boolean Probe334:1; /* Bit 8 */ boolean Probe230:1; /* Bit 9 */
boolean Probe230:1; /* Bit 9 */ boolean Probe234:1; /* Bit 10 */
boolean Probe234:1; /* Bit 10 */ boolean Probe130:1; /* Bit 11 */
boolean Probe130:1; /* Bit 11 */ boolean Probe134:1; /* Bit 12 */
boolean Probe134:1; /* Bit 12 */
}; };
/* /*
Define the Global Options. Define the Global Options.
*/ */
struct BusLogic_GlobalOptions struct BusLogic_GlobalOptions {
{ boolean TraceProbe:1; /* Bit 0 */
boolean TraceProbe:1; /* Bit 0 */ boolean TraceHardwareReset:1; /* Bit 1 */
boolean TraceHardwareReset:1; /* Bit 1 */ boolean TraceConfiguration:1; /* Bit 2 */
boolean TraceConfiguration:1; /* Bit 2 */ boolean TraceErrors:1; /* Bit 3 */
boolean TraceErrors:1; /* Bit 3 */
}; };
/* /*
Define the Local Options. Define the Local Options.
*/ */
struct BusLogic_LocalOptions struct BusLogic_LocalOptions {
{ boolean InhibitTargetInquiry:1; /* Bit 0 */
boolean InhibitTargetInquiry:1; /* Bit 0 */
}; };
/* /*
...@@ -335,198 +322,188 @@ struct BusLogic_LocalOptions ...@@ -335,198 +322,188 @@ struct BusLogic_LocalOptions
Define the structure of the write-only Control Register. Define the structure of the write-only Control Register.
*/ */
union BusLogic_ControlRegister union BusLogic_ControlRegister {
{ unsigned char All;
unsigned char All; struct {
struct { unsigned char:4; /* Bits 0-3 */
unsigned char :4; /* Bits 0-3 */ boolean SCSIBusReset:1; /* Bit 4 */
boolean SCSIBusReset:1; /* Bit 4 */ boolean InterruptReset:1; /* Bit 5 */
boolean InterruptReset:1; /* Bit 5 */ boolean SoftReset:1; /* Bit 6 */
boolean SoftReset:1; /* Bit 6 */ boolean HardReset:1; /* Bit 7 */
boolean HardReset:1; /* Bit 7 */ } cr;
} cr;
}; };
/* /*
Define the structure of the read-only Status Register. Define the structure of the read-only Status Register.
*/ */
union BusLogic_StatusRegister union BusLogic_StatusRegister {
{ unsigned char All;
unsigned char All; struct {
struct { boolean CommandInvalid:1; /* Bit 0 */
boolean CommandInvalid:1; /* Bit 0 */ boolean Reserved:1; /* Bit 1 */
boolean Reserved:1; /* Bit 1 */ boolean DataInRegisterReady:1; /* Bit 2 */
boolean DataInRegisterReady:1; /* Bit 2 */ boolean CommandParameterRegisterBusy:1; /* Bit 3 */
boolean CommandParameterRegisterBusy:1; /* Bit 3 */ boolean HostAdapterReady:1; /* Bit 4 */
boolean HostAdapterReady:1; /* Bit 4 */ boolean InitializationRequired:1; /* Bit 5 */
boolean InitializationRequired:1; /* Bit 5 */ boolean DiagnosticFailure:1; /* Bit 6 */
boolean DiagnosticFailure:1; /* Bit 6 */ boolean DiagnosticActive:1; /* Bit 7 */
boolean DiagnosticActive:1; /* Bit 7 */ } sr;
} sr;
}; };
/* /*
Define the structure of the read-only Interrupt Register. Define the structure of the read-only Interrupt Register.
*/ */
union BusLogic_InterruptRegister union BusLogic_InterruptRegister {
{ unsigned char All;
unsigned char All; struct {
struct { boolean IncomingMailboxLoaded:1; /* Bit 0 */
boolean IncomingMailboxLoaded:1; /* Bit 0 */ boolean OutgoingMailboxAvailable:1; /* Bit 1 */
boolean OutgoingMailboxAvailable:1; /* Bit 1 */ boolean CommandComplete:1; /* Bit 2 */
boolean CommandComplete:1; /* Bit 2 */ boolean ExternalBusReset:1; /* Bit 3 */
boolean ExternalBusReset:1; /* Bit 3 */ unsigned char Reserved:3; /* Bits 4-6 */
unsigned char Reserved:3; /* Bits 4-6 */ boolean InterruptValid:1; /* Bit 7 */
boolean InterruptValid:1; /* Bit 7 */ } ir;
} ir;
}; };
/* /*
Define the structure of the read-only Geometry Register. Define the structure of the read-only Geometry Register.
*/ */
union BusLogic_GeometryRegister union BusLogic_GeometryRegister {
{ unsigned char All;
unsigned char All; struct {
struct { enum BusLogic_BIOS_DiskGeometryTranslation Drive0Geometry:2; /* Bits 0-1 */
enum BusLogic_BIOS_DiskGeometryTranslation Drive0Geometry:2;/* Bits 0-1 */ enum BusLogic_BIOS_DiskGeometryTranslation Drive1Geometry:2; /* Bits 2-3 */
enum BusLogic_BIOS_DiskGeometryTranslation Drive1Geometry:2;/* Bits 2-3 */ unsigned char:3; /* Bits 4-6 */
unsigned char :3; /* Bits 4-6 */ boolean ExtendedTranslationEnabled:1; /* Bit 7 */
boolean ExtendedTranslationEnabled:1; /* Bit 7 */ } gr;
} gr;
}; };
/* /*
Define the BusLogic SCSI Host Adapter Command Register Operation Codes. Define the BusLogic SCSI Host Adapter Command Register Operation Codes.
*/ */
enum BusLogic_OperationCode enum BusLogic_OperationCode {
{ BusLogic_TestCommandCompleteInterrupt = 0x00,
BusLogic_TestCommandCompleteInterrupt = 0x00, BusLogic_InitializeMailbox = 0x01,
BusLogic_InitializeMailbox = 0x01, BusLogic_ExecuteMailboxCommand = 0x02,
BusLogic_ExecuteMailboxCommand = 0x02, BusLogic_ExecuteBIOSCommand = 0x03,
BusLogic_ExecuteBIOSCommand = 0x03, BusLogic_InquireBoardID = 0x04,
BusLogic_InquireBoardID = 0x04, BusLogic_EnableOutgoingMailboxAvailableInt = 0x05,
BusLogic_EnableOutgoingMailboxAvailableInt = 0x05, BusLogic_SetSCSISelectionTimeout = 0x06,
BusLogic_SetSCSISelectionTimeout = 0x06, BusLogic_SetPreemptTimeOnBus = 0x07,
BusLogic_SetPreemptTimeOnBus = 0x07, BusLogic_SetTimeOffBus = 0x08,
BusLogic_SetTimeOffBus = 0x08, BusLogic_SetBusTransferRate = 0x09,
BusLogic_SetBusTransferRate = 0x09, BusLogic_InquireInstalledDevicesID0to7 = 0x0A,
BusLogic_InquireInstalledDevicesID0to7 = 0x0A, BusLogic_InquireConfiguration = 0x0B,
BusLogic_InquireConfiguration = 0x0B, BusLogic_EnableTargetMode = 0x0C,
BusLogic_EnableTargetMode = 0x0C, BusLogic_InquireSetupInformation = 0x0D,
BusLogic_InquireSetupInformation = 0x0D, BusLogic_WriteAdapterLocalRAM = 0x1A,
BusLogic_WriteAdapterLocalRAM = 0x1A, BusLogic_ReadAdapterLocalRAM = 0x1B,
BusLogic_ReadAdapterLocalRAM = 0x1B, BusLogic_WriteBusMasterChipFIFO = 0x1C,
BusLogic_WriteBusMasterChipFIFO = 0x1C, BusLogic_ReadBusMasterChipFIFO = 0x1D,
BusLogic_ReadBusMasterChipFIFO = 0x1D, BusLogic_EchoCommandData = 0x1F,
BusLogic_EchoCommandData = 0x1F, BusLogic_HostAdapterDiagnostic = 0x20,
BusLogic_HostAdapterDiagnostic = 0x20, BusLogic_SetAdapterOptions = 0x21,
BusLogic_SetAdapterOptions = 0x21, BusLogic_InquireInstalledDevicesID8to15 = 0x23,
BusLogic_InquireInstalledDevicesID8to15 = 0x23, BusLogic_InquireTargetDevices = 0x24,
BusLogic_InquireTargetDevices = 0x24, BusLogic_DisableHostAdapterInterrupt = 0x25,
BusLogic_DisableHostAdapterInterrupt = 0x25, BusLogic_InitializeExtendedMailbox = 0x81,
BusLogic_InitializeExtendedMailbox = 0x81, BusLogic_ExecuteSCSICommand = 0x83,
BusLogic_ExecuteSCSICommand = 0x83, BusLogic_InquireFirmwareVersion3rdDigit = 0x84,
BusLogic_InquireFirmwareVersion3rdDigit = 0x84, BusLogic_InquireFirmwareVersionLetter = 0x85,
BusLogic_InquireFirmwareVersionLetter = 0x85, BusLogic_InquirePCIHostAdapterInformation = 0x86,
BusLogic_InquirePCIHostAdapterInformation = 0x86, BusLogic_InquireHostAdapterModelNumber = 0x8B,
BusLogic_InquireHostAdapterModelNumber = 0x8B, BusLogic_InquireSynchronousPeriod = 0x8C,
BusLogic_InquireSynchronousPeriod = 0x8C, BusLogic_InquireExtendedSetupInformation = 0x8D,
BusLogic_InquireExtendedSetupInformation = 0x8D, BusLogic_EnableStrictRoundRobinMode = 0x8F,
BusLogic_EnableStrictRoundRobinMode = 0x8F, BusLogic_StoreHostAdapterLocalRAM = 0x90,
BusLogic_StoreHostAdapterLocalRAM = 0x90, BusLogic_FetchHostAdapterLocalRAM = 0x91,
BusLogic_FetchHostAdapterLocalRAM = 0x91, BusLogic_StoreLocalDataInEEPROM = 0x92,
BusLogic_StoreLocalDataInEEPROM = 0x92, BusLogic_UploadAutoSCSICode = 0x94,
BusLogic_UploadAutoSCSICode = 0x94, BusLogic_ModifyIOAddress = 0x95,
BusLogic_ModifyIOAddress = 0x95, BusLogic_SetCCBFormat = 0x96,
BusLogic_SetCCBFormat = 0x96, BusLogic_WriteInquiryBuffer = 0x9A,
BusLogic_WriteInquiryBuffer = 0x9A, BusLogic_ReadInquiryBuffer = 0x9B,
BusLogic_ReadInquiryBuffer = 0x9B, BusLogic_FlashROMUploadDownload = 0xA7,
BusLogic_FlashROMUploadDownload = 0xA7, BusLogic_ReadSCAMData = 0xA8,
BusLogic_ReadSCAMData = 0xA8, BusLogic_WriteSCAMData = 0xA9
BusLogic_WriteSCAMData = 0xA9
}; };
/* /*
Define the Inquire Board ID reply structure. Define the Inquire Board ID reply structure.
*/ */
struct BusLogic_BoardID struct BusLogic_BoardID {
{ unsigned char BoardType; /* Byte 0 */
unsigned char BoardType; /* Byte 0 */ unsigned char CustomFeatures; /* Byte 1 */
unsigned char CustomFeatures; /* Byte 1 */ unsigned char FirmwareVersion1stDigit; /* Byte 2 */
unsigned char FirmwareVersion1stDigit; /* Byte 2 */ unsigned char FirmwareVersion2ndDigit; /* Byte 3 */
unsigned char FirmwareVersion2ndDigit; /* Byte 3 */
}; };
/* /*
Define the Inquire Configuration reply structure. Define the Inquire Configuration reply structure.
*/ */
struct BusLogic_Configuration struct BusLogic_Configuration {
{ unsigned char:5; /* Byte 0 Bits 0-4 */
unsigned char :5; /* Byte 0 Bits 0-4 */ boolean DMA_Channel5:1; /* Byte 0 Bit 5 */
boolean DMA_Channel5:1; /* Byte 0 Bit 5 */ boolean DMA_Channel6:1; /* Byte 0 Bit 6 */
boolean DMA_Channel6:1; /* Byte 0 Bit 6 */ boolean DMA_Channel7:1; /* Byte 0 Bit 7 */
boolean DMA_Channel7:1; /* Byte 0 Bit 7 */ boolean IRQ_Channel9:1; /* Byte 1 Bit 0 */
boolean IRQ_Channel9:1; /* Byte 1 Bit 0 */ boolean IRQ_Channel10:1; /* Byte 1 Bit 1 */
boolean IRQ_Channel10:1; /* Byte 1 Bit 1 */ boolean IRQ_Channel11:1; /* Byte 1 Bit 2 */
boolean IRQ_Channel11:1; /* Byte 1 Bit 2 */ boolean IRQ_Channel12:1; /* Byte 1 Bit 3 */
boolean IRQ_Channel12:1; /* Byte 1 Bit 3 */ unsigned char:1; /* Byte 1 Bit 4 */
unsigned char :1; /* Byte 1 Bit 4 */ boolean IRQ_Channel14:1; /* Byte 1 Bit 5 */
boolean IRQ_Channel14:1; /* Byte 1 Bit 5 */ boolean IRQ_Channel15:1; /* Byte 1 Bit 6 */
boolean IRQ_Channel15:1; /* Byte 1 Bit 6 */ unsigned char:1; /* Byte 1 Bit 7 */
unsigned char :1; /* Byte 1 Bit 7 */ unsigned char HostAdapterID:4; /* Byte 2 Bits 0-3 */
unsigned char HostAdapterID:4; /* Byte 2 Bits 0-3 */ unsigned char:4; /* Byte 2 Bits 4-7 */
unsigned char :4; /* Byte 2 Bits 4-7 */
}; };
/* /*
Define the Inquire Setup Information reply structure. Define the Inquire Setup Information reply structure.
*/ */
struct BusLogic_SynchronousValue struct BusLogic_SynchronousValue {
{ unsigned char Offset:4; /* Bits 0-3 */
unsigned char Offset:4; /* Bits 0-3 */ unsigned char TransferPeriod:3; /* Bits 4-6 */
unsigned char TransferPeriod:3; /* Bits 4-6 */ boolean Synchronous:1; /* Bit 7 */
boolean Synchronous:1; /* Bit 7 */
}; };
struct BusLogic_SetupInformation struct BusLogic_SetupInformation {
{ boolean SynchronousInitiationEnabled:1; /* Byte 0 Bit 0 */
boolean SynchronousInitiationEnabled:1; /* Byte 0 Bit 0 */ boolean ParityCheckingEnabled:1; /* Byte 0 Bit 1 */
boolean ParityCheckingEnabled:1; /* Byte 0 Bit 1 */ unsigned char:6; /* Byte 0 Bits 2-7 */
unsigned char :6; /* Byte 0 Bits 2-7 */ unsigned char BusTransferRate; /* Byte 1 */
unsigned char BusTransferRate; /* Byte 1 */ unsigned char PreemptTimeOnBus; /* Byte 2 */
unsigned char PreemptTimeOnBus; /* Byte 2 */ unsigned char TimeOffBus; /* Byte 3 */
unsigned char TimeOffBus; /* Byte 3 */ unsigned char MailboxCount; /* Byte 4 */
unsigned char MailboxCount; /* Byte 4 */ unsigned char MailboxAddress[3]; /* Bytes 5-7 */
unsigned char MailboxAddress[3]; /* Bytes 5-7 */ struct BusLogic_SynchronousValue SynchronousValuesID0to7[8]; /* Bytes 8-15 */
struct BusLogic_SynchronousValue SynchronousValuesID0to7[8];/* Bytes 8-15 */ unsigned char DisconnectPermittedID0to7; /* Byte 16 */
unsigned char DisconnectPermittedID0to7; /* Byte 16 */ unsigned char Signature; /* Byte 17 */
unsigned char Signature; /* Byte 17 */ unsigned char CharacterD; /* Byte 18 */
unsigned char CharacterD; /* Byte 18 */ unsigned char HostBusType; /* Byte 19 */
unsigned char HostBusType; /* Byte 19 */ unsigned char WideTransfersPermittedID0to7; /* Byte 20 */
unsigned char WideTransfersPermittedID0to7; /* Byte 20 */ unsigned char WideTransfersActiveID0to7; /* Byte 21 */
unsigned char WideTransfersActiveID0to7; /* Byte 21 */ struct BusLogic_SynchronousValue SynchronousValuesID8to15[8]; /* Bytes 22-29 */
struct BusLogic_SynchronousValue SynchronousValuesID8to15[8]; /* Bytes 22-29 */ unsigned char DisconnectPermittedID8to15; /* Byte 30 */
unsigned char DisconnectPermittedID8to15; /* Byte 30 */ unsigned char:8; /* Byte 31 */
unsigned char :8; /* Byte 31 */ unsigned char WideTransfersPermittedID8to15; /* Byte 32 */
unsigned char WideTransfersPermittedID8to15; /* Byte 32 */ unsigned char WideTransfersActiveID8to15; /* Byte 33 */
unsigned char WideTransfersActiveID8to15; /* Byte 33 */
}; };
/* /*
Define the Initialize Extended Mailbox request structure. Define the Initialize Extended Mailbox request structure.
*/ */
struct BusLogic_ExtendedMailboxRequest struct BusLogic_ExtendedMailboxRequest {
{ unsigned char MailboxCount; /* Byte 0 */
unsigned char MailboxCount; /* Byte 0 */ u32 BaseMailboxAddress; /* Bytes 1-4 */
u32 BaseMailboxAddress; /* Bytes 1-4 */
} PACKED; } PACKED;
...@@ -536,67 +513,63 @@ struct BusLogic_ExtendedMailboxRequest ...@@ -536,67 +513,63 @@ struct BusLogic_ExtendedMailboxRequest
the Modify I/O Address command. the Modify I/O Address command.
*/ */
enum BusLogic_ISACompatibleIOPort enum BusLogic_ISACompatibleIOPort {
{ BusLogic_IO_330 = 0,
BusLogic_IO_330 = 0, BusLogic_IO_334 = 1,
BusLogic_IO_334 = 1, BusLogic_IO_230 = 2,
BusLogic_IO_230 = 2, BusLogic_IO_234 = 3,
BusLogic_IO_234 = 3, BusLogic_IO_130 = 4,
BusLogic_IO_130 = 4, BusLogic_IO_134 = 5,
BusLogic_IO_134 = 5, BusLogic_IO_Disable = 6,
BusLogic_IO_Disable = 6, BusLogic_IO_Disable2 = 7
BusLogic_IO_Disable2 = 7
} PACKED; } PACKED;
struct BusLogic_PCIHostAdapterInformation struct BusLogic_PCIHostAdapterInformation {
{ enum BusLogic_ISACompatibleIOPort ISACompatibleIOPort; /* Byte 0 */
enum BusLogic_ISACompatibleIOPort ISACompatibleIOPort;/* Byte 0 */ unsigned char PCIAssignedIRQChannel; /* Byte 1 */
unsigned char PCIAssignedIRQChannel; /* Byte 1 */ boolean LowByteTerminated:1; /* Byte 2 Bit 0 */
boolean LowByteTerminated:1; /* Byte 2 Bit 0 */ boolean HighByteTerminated:1; /* Byte 2 Bit 1 */
boolean HighByteTerminated:1; /* Byte 2 Bit 1 */ unsigned char:2; /* Byte 2 Bits 2-3 */
unsigned char :2; /* Byte 2 Bits 2-3 */ boolean JP1:1; /* Byte 2 Bit 4 */
boolean JP1:1; /* Byte 2 Bit 4 */ boolean JP2:1; /* Byte 2 Bit 5 */
boolean JP2:1; /* Byte 2 Bit 5 */ boolean JP3:1; /* Byte 2 Bit 6 */
boolean JP3:1; /* Byte 2 Bit 6 */ boolean GenericInfoValid:1; /* Byte 2 Bit 7 */
boolean GenericInfoValid:1; /* Byte 2 Bit 7 */ unsigned char:8; /* Byte 3 */
unsigned char :8; /* Byte 3 */
}; };
/* /*
Define the Inquire Extended Setup Information reply structure. Define the Inquire Extended Setup Information reply structure.
*/ */
struct BusLogic_ExtendedSetupInformation struct BusLogic_ExtendedSetupInformation {
{ unsigned char BusType; /* Byte 0 */
unsigned char BusType; /* Byte 0 */ unsigned char BIOS_Address; /* Byte 1 */
unsigned char BIOS_Address; /* Byte 1 */ unsigned short ScatterGatherLimit; /* Bytes 2-3 */
unsigned short ScatterGatherLimit; /* Bytes 2-3 */ unsigned char MailboxCount; /* Byte 4 */
unsigned char MailboxCount; /* Byte 4 */ u32 BaseMailboxAddress; /* Bytes 5-8 */
u32 BaseMailboxAddress; /* Bytes 5-8 */ struct {
struct { unsigned char:2; /* Byte 9 Bits 0-1 */
unsigned char :2; /* Byte 9 Bits 0-1 */ boolean FastOnEISA:1; /* Byte 9 Bit 2 */
boolean FastOnEISA:1; /* Byte 9 Bit 2 */ unsigned char:3; /* Byte 9 Bits 3-5 */
unsigned char :3; /* Byte 9 Bits 3-5 */ boolean LevelSensitiveInterrupt:1; /* Byte 9 Bit 6 */
boolean LevelSensitiveInterrupt:1; /* Byte 9 Bit 6 */ unsigned char:1; /* Byte 9 Bit 7 */
unsigned char :1; /* Byte 9 Bit 7 */ } Misc;
} Misc; unsigned char FirmwareRevision[3]; /* Bytes 10-12 */
unsigned char FirmwareRevision[3]; /* Bytes 10-12 */ boolean HostWideSCSI:1; /* Byte 13 Bit 0 */
boolean HostWideSCSI:1; /* Byte 13 Bit 0 */ boolean HostDifferentialSCSI:1; /* Byte 13 Bit 1 */
boolean HostDifferentialSCSI:1; /* Byte 13 Bit 1 */ boolean HostSupportsSCAM:1; /* Byte 13 Bit 2 */
boolean HostSupportsSCAM:1; /* Byte 13 Bit 2 */ boolean HostUltraSCSI:1; /* Byte 13 Bit 3 */
boolean HostUltraSCSI:1; /* Byte 13 Bit 3 */ boolean HostSmartTermination:1; /* Byte 13 Bit 4 */
boolean HostSmartTermination:1; /* Byte 13 Bit 4 */ unsigned char:3; /* Byte 13 Bits 5-7 */
unsigned char :3; /* Byte 13 Bits 5-7 */
} PACKED; } PACKED;
/* /*
Define the Enable Strict Round Robin Mode request type. Define the Enable Strict Round Robin Mode request type.
*/ */
enum BusLogic_RoundRobinModeRequest enum BusLogic_RoundRobinModeRequest {
{ BusLogic_AggressiveRoundRobinMode = 0,
BusLogic_AggressiveRoundRobinMode = 0, BusLogic_StrictRoundRobinMode = 1
BusLogic_StrictRoundRobinMode = 1
} PACKED; } PACKED;
...@@ -607,96 +580,93 @@ enum BusLogic_RoundRobinModeRequest ...@@ -607,96 +580,93 @@ enum BusLogic_RoundRobinModeRequest
#define BusLogic_BIOS_BaseOffset 0 #define BusLogic_BIOS_BaseOffset 0
#define BusLogic_AutoSCSI_BaseOffset 64 #define BusLogic_AutoSCSI_BaseOffset 64
struct BusLogic_FetchHostAdapterLocalRAMRequest struct BusLogic_FetchHostAdapterLocalRAMRequest {
{ unsigned char ByteOffset; /* Byte 0 */
unsigned char ByteOffset; /* Byte 0 */ unsigned char ByteCount; /* Byte 1 */
unsigned char ByteCount; /* Byte 1 */
}; };
/* /*
Define the Host Adapter Local RAM AutoSCSI structure. Define the Host Adapter Local RAM AutoSCSI structure.
*/ */
struct BusLogic_AutoSCSIData struct BusLogic_AutoSCSIData {
{ unsigned char InternalFactorySignature[2]; /* Bytes 0-1 */
unsigned char InternalFactorySignature[2]; /* Bytes 0-1 */ unsigned char InformationByteCount; /* Byte 2 */
unsigned char InformationByteCount; /* Byte 2 */ unsigned char HostAdapterType[6]; /* Bytes 3-8 */
unsigned char HostAdapterType[6]; /* Bytes 3-8 */ unsigned char:8; /* Byte 9 */
unsigned char :8; /* Byte 9 */ boolean FloppyEnabled:1; /* Byte 10 Bit 0 */
boolean FloppyEnabled:1; /* Byte 10 Bit 0 */ boolean FloppySecondary:1; /* Byte 10 Bit 1 */
boolean FloppySecondary:1; /* Byte 10 Bit 1 */ boolean LevelSensitiveInterrupt:1; /* Byte 10 Bit 2 */
boolean LevelSensitiveInterrupt:1; /* Byte 10 Bit 2 */ unsigned char:2; /* Byte 10 Bits 3-4 */
unsigned char :2; /* Byte 10 Bits 3-4 */ unsigned char SystemRAMAreaForBIOS:3; /* Byte 10 Bits 5-7 */
unsigned char SystemRAMAreaForBIOS:3; /* Byte 10 Bits 5-7 */ unsigned char DMA_Channel:7; /* Byte 11 Bits 0-6 */
unsigned char DMA_Channel:7; /* Byte 11 Bits 0-6 */ boolean DMA_AutoConfiguration:1; /* Byte 11 Bit 7 */
boolean DMA_AutoConfiguration:1; /* Byte 11 Bit 7 */ unsigned char IRQ_Channel:7; /* Byte 12 Bits 0-6 */
unsigned char IRQ_Channel:7; /* Byte 12 Bits 0-6 */ boolean IRQ_AutoConfiguration:1; /* Byte 12 Bit 7 */
boolean IRQ_AutoConfiguration:1; /* Byte 12 Bit 7 */ unsigned char DMA_TransferRate; /* Byte 13 */
unsigned char DMA_TransferRate; /* Byte 13 */ unsigned char SCSI_ID; /* Byte 14 */
unsigned char SCSI_ID; /* Byte 14 */ boolean LowByteTerminated:1; /* Byte 15 Bit 0 */
boolean LowByteTerminated:1; /* Byte 15 Bit 0 */ boolean ParityCheckingEnabled:1; /* Byte 15 Bit 1 */
boolean ParityCheckingEnabled:1; /* Byte 15 Bit 1 */ boolean HighByteTerminated:1; /* Byte 15 Bit 2 */
boolean HighByteTerminated:1; /* Byte 15 Bit 2 */ boolean NoisyCablingEnvironment:1; /* Byte 15 Bit 3 */
boolean NoisyCablingEnvironment:1; /* Byte 15 Bit 3 */ boolean FastSynchronousNegotiation:1; /* Byte 15 Bit 4 */
boolean FastSynchronousNegotiation:1; /* Byte 15 Bit 4 */ boolean BusResetEnabled:1; /* Byte 15 Bit 5 */
boolean BusResetEnabled:1; /* Byte 15 Bit 5 */ boolean:1; /* Byte 15 Bit 6 */
boolean :1; /* Byte 15 Bit 6 */ boolean ActiveNegationEnabled:1; /* Byte 15 Bit 7 */
boolean ActiveNegationEnabled:1; /* Byte 15 Bit 7 */ unsigned char BusOnDelay; /* Byte 16 */
unsigned char BusOnDelay; /* Byte 16 */ unsigned char BusOffDelay; /* Byte 17 */
unsigned char BusOffDelay; /* Byte 17 */ boolean HostAdapterBIOSEnabled:1; /* Byte 18 Bit 0 */
boolean HostAdapterBIOSEnabled:1; /* Byte 18 Bit 0 */ boolean BIOSRedirectionOfINT19Enabled:1; /* Byte 18 Bit 1 */
boolean BIOSRedirectionOfINT19Enabled:1; /* Byte 18 Bit 1 */ boolean ExtendedTranslationEnabled:1; /* Byte 18 Bit 2 */
boolean ExtendedTranslationEnabled:1; /* Byte 18 Bit 2 */ boolean MapRemovableAsFixedEnabled:1; /* Byte 18 Bit 3 */
boolean MapRemovableAsFixedEnabled:1; /* Byte 18 Bit 3 */ boolean:1; /* Byte 18 Bit 4 */
boolean :1; /* Byte 18 Bit 4 */ boolean BIOSSupportsMoreThan2DrivesEnabled:1; /* Byte 18 Bit 5 */
boolean BIOSSupportsMoreThan2DrivesEnabled:1; /* Byte 18 Bit 5 */ boolean BIOSInterruptModeEnabled:1; /* Byte 18 Bit 6 */
boolean BIOSInterruptModeEnabled:1; /* Byte 18 Bit 6 */ boolean FlopticalSupportEnabled:1; /* Byte 19 Bit 7 */
boolean FlopticalSupportEnabled:1; /* Byte 19 Bit 7 */ unsigned short DeviceEnabled; /* Bytes 19-20 */
unsigned short DeviceEnabled; /* Bytes 19-20 */ unsigned short WidePermitted; /* Bytes 21-22 */
unsigned short WidePermitted; /* Bytes 21-22 */ unsigned short FastPermitted; /* Bytes 23-24 */
unsigned short FastPermitted; /* Bytes 23-24 */ unsigned short SynchronousPermitted; /* Bytes 25-26 */
unsigned short SynchronousPermitted; /* Bytes 25-26 */ unsigned short DisconnectPermitted; /* Bytes 27-28 */
unsigned short DisconnectPermitted; /* Bytes 27-28 */ unsigned short SendStartUnitCommand; /* Bytes 29-30 */
unsigned short SendStartUnitCommand; /* Bytes 29-30 */ unsigned short IgnoreInBIOSScan; /* Bytes 31-32 */
unsigned short IgnoreInBIOSScan; /* Bytes 31-32 */ unsigned char PCIInterruptPin:2; /* Byte 33 Bits 0-1 */
unsigned char PCIInterruptPin:2; /* Byte 33 Bits 0-1 */ unsigned char HostAdapterIOPortAddress:2; /* Byte 33 Bits 2-3 */
unsigned char HostAdapterIOPortAddress:2; /* Byte 33 Bits 2-3 */ boolean StrictRoundRobinModeEnabled:1; /* Byte 33 Bit 4 */
boolean StrictRoundRobinModeEnabled:1; /* Byte 33 Bit 4 */ boolean VESABusSpeedGreaterThan33MHz:1; /* Byte 33 Bit 5 */
boolean VESABusSpeedGreaterThan33MHz:1; /* Byte 33 Bit 5 */ boolean VESABurstWriteEnabled:1; /* Byte 33 Bit 6 */
boolean VESABurstWriteEnabled:1; /* Byte 33 Bit 6 */ boolean VESABurstReadEnabled:1; /* Byte 33 Bit 7 */
boolean VESABurstReadEnabled:1; /* Byte 33 Bit 7 */ unsigned short UltraPermitted; /* Bytes 34-35 */
unsigned short UltraPermitted; /* Bytes 34-35 */ unsigned int:32; /* Bytes 36-39 */
unsigned int :32; /* Bytes 36-39 */ unsigned char:8; /* Byte 40 */
unsigned char :8; /* Byte 40 */ unsigned char AutoSCSIMaximumLUN; /* Byte 41 */
unsigned char AutoSCSIMaximumLUN; /* Byte 41 */ boolean:1; /* Byte 42 Bit 0 */
boolean :1; /* Byte 42 Bit 0 */ boolean SCAM_Dominant:1; /* Byte 42 Bit 1 */
boolean SCAM_Dominant:1; /* Byte 42 Bit 1 */ boolean SCAM_Enabled:1; /* Byte 42 Bit 2 */
boolean SCAM_Enabled:1; /* Byte 42 Bit 2 */ boolean SCAM_Level2:1; /* Byte 42 Bit 3 */
boolean SCAM_Level2:1; /* Byte 42 Bit 3 */ unsigned char:4; /* Byte 42 Bits 4-7 */
unsigned char :4; /* Byte 42 Bits 4-7 */ boolean INT13ExtensionEnabled:1; /* Byte 43 Bit 0 */
boolean INT13ExtensionEnabled:1; /* Byte 43 Bit 0 */ boolean:1; /* Byte 43 Bit 1 */
boolean :1; /* Byte 43 Bit 1 */ boolean CDROMBootEnabled:1; /* Byte 43 Bit 2 */
boolean CDROMBootEnabled:1; /* Byte 43 Bit 2 */ unsigned char:5; /* Byte 43 Bits 3-7 */
unsigned char :5; /* Byte 43 Bits 3-7 */ unsigned char BootTargetID:4; /* Byte 44 Bits 0-3 */
unsigned char BootTargetID:4; /* Byte 44 Bits 0-3 */ unsigned char BootChannel:4; /* Byte 44 Bits 4-7 */
unsigned char BootChannel:4; /* Byte 44 Bits 4-7 */ unsigned char ForceBusDeviceScanningOrder:1; /* Byte 45 Bit 0 */
unsigned char ForceBusDeviceScanningOrder:1; /* Byte 45 Bit 0 */ unsigned char:7; /* Byte 45 Bits 1-7 */
unsigned char :7; /* Byte 45 Bits 1-7 */ unsigned short NonTaggedToAlternateLUNPermitted; /* Bytes 46-47 */
unsigned short NonTaggedToAlternateLUNPermitted; /* Bytes 46-47 */ unsigned short RenegotiateSyncAfterCheckCondition; /* Bytes 48-49 */
unsigned short RenegotiateSyncAfterCheckCondition; /* Bytes 48-49 */ unsigned char Reserved[10]; /* Bytes 50-59 */
unsigned char Reserved[10]; /* Bytes 50-59 */ unsigned char ManufacturingDiagnostic[2]; /* Bytes 60-61 */
unsigned char ManufacturingDiagnostic[2]; /* Bytes 60-61 */ unsigned short Checksum; /* Bytes 62-63 */
unsigned short Checksum; /* Bytes 62-63 */
} PACKED; } PACKED;
/* /*
Define the Host Adapter Local RAM Auto SCSI Byte 45 structure. Define the Host Adapter Local RAM Auto SCSI Byte 45 structure.
*/ */
struct BusLogic_AutoSCSIByte45 struct BusLogic_AutoSCSIByte45 {
{ unsigned char ForceBusDeviceScanningOrder:1; /* Bit 0 */
unsigned char ForceBusDeviceScanningOrder:1; /* Bit 0 */ unsigned char:7; /* Bits 1-7 */
unsigned char :7; /* Bits 1-7 */
}; };
/* /*
...@@ -705,12 +675,11 @@ struct BusLogic_AutoSCSIByte45 ...@@ -705,12 +675,11 @@ struct BusLogic_AutoSCSIByte45
#define BusLogic_BIOS_DriveMapOffset 17 #define BusLogic_BIOS_DriveMapOffset 17
struct BusLogic_BIOSDriveMapByte struct BusLogic_BIOSDriveMapByte {
{ unsigned char TargetIDBit3:1; /* Bit 0 */
unsigned char TargetIDBit3:1; /* Bit 0 */ unsigned char:2; /* Bits 1-2 */
unsigned char :2; /* Bits 1-2 */ enum BusLogic_BIOS_DiskGeometryTranslation DiskGeometry:2; /* Bits 3-4 */
enum BusLogic_BIOS_DiskGeometryTranslation DiskGeometry:2; /* Bits 3-4 */ unsigned char TargetID:3; /* Bits 5-7 */
unsigned char TargetID:3; /* Bits 5-7 */
}; };
/* /*
...@@ -718,21 +687,19 @@ struct BusLogic_BIOSDriveMapByte ...@@ -718,21 +687,19 @@ struct BusLogic_BIOSDriveMapByte
necessary to support more than 8 Logical Units per Target Device. necessary to support more than 8 Logical Units per Target Device.
*/ */
enum BusLogic_SetCCBFormatRequest enum BusLogic_SetCCBFormatRequest {
{ BusLogic_LegacyLUNFormatCCB = 0,
BusLogic_LegacyLUNFormatCCB = 0, BusLogic_ExtendedLUNFormatCCB = 1
BusLogic_ExtendedLUNFormatCCB = 1
} PACKED; } PACKED;
/* /*
Define the Outgoing Mailbox Action Codes. Define the Outgoing Mailbox Action Codes.
*/ */
enum BusLogic_ActionCode enum BusLogic_ActionCode {
{ BusLogic_OutgoingMailboxFree = 0x00,
BusLogic_OutgoingMailboxFree = 0x00, BusLogic_MailboxStartCommand = 0x01,
BusLogic_MailboxStartCommand = 0x01, BusLogic_MailboxAbortCommand = 0x02
BusLogic_MailboxAbortCommand = 0x02
} PACKED; } PACKED;
...@@ -742,28 +709,26 @@ enum BusLogic_ActionCode ...@@ -742,28 +709,26 @@ enum BusLogic_ActionCode
completion codes are stored in the CCB; it only uses codes 1, 2, 4, and 5. completion codes are stored in the CCB; it only uses codes 1, 2, 4, and 5.
*/ */
enum BusLogic_CompletionCode enum BusLogic_CompletionCode {
{ BusLogic_IncomingMailboxFree = 0x00,
BusLogic_IncomingMailboxFree = 0x00, BusLogic_CommandCompletedWithoutError = 0x01,
BusLogic_CommandCompletedWithoutError = 0x01, BusLogic_CommandAbortedAtHostRequest = 0x02,
BusLogic_CommandAbortedAtHostRequest = 0x02, BusLogic_AbortedCommandNotFound = 0x03,
BusLogic_AbortedCommandNotFound = 0x03, BusLogic_CommandCompletedWithError = 0x04,
BusLogic_CommandCompletedWithError = 0x04, BusLogic_InvalidCCB = 0x05
BusLogic_InvalidCCB = 0x05
} PACKED; } PACKED;
/* /*
Define the Command Control Block (CCB) Opcodes. Define the Command Control Block (CCB) Opcodes.
*/ */
enum BusLogic_CCB_Opcode enum BusLogic_CCB_Opcode {
{ BusLogic_InitiatorCCB = 0x00,
BusLogic_InitiatorCCB = 0x00, BusLogic_TargetCCB = 0x01,
BusLogic_TargetCCB = 0x01, BusLogic_InitiatorCCB_ScatterGather = 0x02,
BusLogic_InitiatorCCB_ScatterGather = 0x02, BusLogic_InitiatorCCB_ResidualDataLength = 0x03,
BusLogic_InitiatorCCB_ResidualDataLength = 0x03, BusLogic_InitiatorCCB_ScatterGatherResidual = 0x04,
BusLogic_InitiatorCCB_ScatterGatherResidual = 0x04, BusLogic_BusDeviceReset = 0x81
BusLogic_BusDeviceReset = 0x81
} PACKED; } PACKED;
...@@ -771,12 +736,11 @@ enum BusLogic_CCB_Opcode ...@@ -771,12 +736,11 @@ enum BusLogic_CCB_Opcode
Define the CCB Data Direction Codes. Define the CCB Data Direction Codes.
*/ */
enum BusLogic_DataDirection enum BusLogic_DataDirection {
{ BusLogic_UncheckedDataTransfer = 0,
BusLogic_UncheckedDataTransfer = 0, BusLogic_DataInLengthChecked = 1,
BusLogic_DataInLengthChecked = 1, BusLogic_DataOutLengthChecked = 2,
BusLogic_DataOutLengthChecked = 2, BusLogic_NoDataTransfer = 3
BusLogic_NoDataTransfer = 3
}; };
...@@ -785,33 +749,32 @@ enum BusLogic_DataDirection ...@@ -785,33 +749,32 @@ enum BusLogic_DataDirection
return status code 0x0C; it uses 0x12 for both overruns and underruns. return status code 0x0C; it uses 0x12 for both overruns and underruns.
*/ */
enum BusLogic_HostAdapterStatus enum BusLogic_HostAdapterStatus {
{ BusLogic_CommandCompletedNormally = 0x00,
BusLogic_CommandCompletedNormally = 0x00, BusLogic_LinkedCommandCompleted = 0x0A,
BusLogic_LinkedCommandCompleted = 0x0A, BusLogic_LinkedCommandCompletedWithFlag = 0x0B,
BusLogic_LinkedCommandCompletedWithFlag = 0x0B, BusLogic_DataUnderRun = 0x0C,
BusLogic_DataUnderRun = 0x0C, BusLogic_SCSISelectionTimeout = 0x11,
BusLogic_SCSISelectionTimeout = 0x11, BusLogic_DataOverRun = 0x12,
BusLogic_DataOverRun = 0x12, BusLogic_UnexpectedBusFree = 0x13,
BusLogic_UnexpectedBusFree = 0x13, BusLogic_InvalidBusPhaseRequested = 0x14,
BusLogic_InvalidBusPhaseRequested = 0x14, BusLogic_InvalidOutgoingMailboxActionCode = 0x15,
BusLogic_InvalidOutgoingMailboxActionCode = 0x15, BusLogic_InvalidCommandOperationCode = 0x16,
BusLogic_InvalidCommandOperationCode = 0x16, BusLogic_LinkedCCBhasInvalidLUN = 0x17,
BusLogic_LinkedCCBhasInvalidLUN = 0x17, BusLogic_InvalidCommandParameter = 0x1A,
BusLogic_InvalidCommandParameter = 0x1A, BusLogic_AutoRequestSenseFailed = 0x1B,
BusLogic_AutoRequestSenseFailed = 0x1B, BusLogic_TaggedQueuingMessageRejected = 0x1C,
BusLogic_TaggedQueuingMessageRejected = 0x1C, BusLogic_UnsupportedMessageReceived = 0x1D,
BusLogic_UnsupportedMessageReceived = 0x1D, BusLogic_HostAdapterHardwareFailed = 0x20,
BusLogic_HostAdapterHardwareFailed = 0x20, BusLogic_TargetFailedResponseToATN = 0x21,
BusLogic_TargetFailedResponseToATN = 0x21, BusLogic_HostAdapterAssertedRST = 0x22,
BusLogic_HostAdapterAssertedRST = 0x22, BusLogic_OtherDeviceAssertedRST = 0x23,
BusLogic_OtherDeviceAssertedRST = 0x23, BusLogic_TargetDeviceReconnectedImproperly = 0x24,
BusLogic_TargetDeviceReconnectedImproperly = 0x24, BusLogic_HostAdapterAssertedBusDeviceReset = 0x25,
BusLogic_HostAdapterAssertedBusDeviceReset = 0x25, BusLogic_AbortQueueGenerated = 0x26,
BusLogic_AbortQueueGenerated = 0x26, BusLogic_HostAdapterSoftwareError = 0x27,
BusLogic_HostAdapterSoftwareError = 0x27, BusLogic_HostAdapterHardwareTimeoutError = 0x30,
BusLogic_HostAdapterHardwareTimeoutError = 0x30, BusLogic_SCSIParityErrorDetected = 0x34
BusLogic_SCSIParityErrorDetected = 0x34
} PACKED; } PACKED;
...@@ -819,23 +782,21 @@ enum BusLogic_HostAdapterStatus ...@@ -819,23 +782,21 @@ enum BusLogic_HostAdapterStatus
Define the SCSI Target Device Status Codes. Define the SCSI Target Device Status Codes.
*/ */
enum BusLogic_TargetDeviceStatus enum BusLogic_TargetDeviceStatus {
{ BusLogic_OperationGood = 0x00,
BusLogic_OperationGood = 0x00, BusLogic_CheckCondition = 0x02,
BusLogic_CheckCondition = 0x02, BusLogic_DeviceBusy = 0x08
BusLogic_DeviceBusy = 0x08
} PACKED; } PACKED;
/* /*
Define the Queue Tag Codes. Define the Queue Tag Codes.
*/ */
enum BusLogic_QueueTag enum BusLogic_QueueTag {
{ BusLogic_SimpleQueueTag = 0,
BusLogic_SimpleQueueTag = 0, BusLogic_HeadOfQueueTag = 1,
BusLogic_HeadOfQueueTag = 1, BusLogic_OrderedQueueTag = 2,
BusLogic_OrderedQueueTag = 2, BusLogic_ReservedQT = 3
BusLogic_ReservedQT = 3
}; };
/* /*
...@@ -852,22 +813,20 @@ typedef unsigned char SCSI_CDB_T[BusLogic_CDB_MaxLength]; ...@@ -852,22 +813,20 @@ typedef unsigned char SCSI_CDB_T[BusLogic_CDB_MaxLength];
Firmware Interface and the FlashPoint SCCB Manager. Firmware Interface and the FlashPoint SCCB Manager.
*/ */
struct BusLogic_ScatterGatherSegment struct BusLogic_ScatterGatherSegment {
{ u32 SegmentByteCount; /* Bytes 0-3 */
u32 SegmentByteCount; /* Bytes 0-3 */ u32 SegmentDataPointer; /* Bytes 4-7 */
u32 SegmentDataPointer; /* Bytes 4-7 */
}; };
/* /*
Define the Driver CCB Status Codes. Define the Driver CCB Status Codes.
*/ */
enum BusLogic_CCB_Status enum BusLogic_CCB_Status {
{ BusLogic_CCB_Free = 0,
BusLogic_CCB_Free = 0, BusLogic_CCB_Active = 1,
BusLogic_CCB_Active = 1, BusLogic_CCB_Completed = 2,
BusLogic_CCB_Completed = 2, BusLogic_CCB_Reset = 3
BusLogic_CCB_Reset = 3
} PACKED; } PACKED;
...@@ -890,82 +849,79 @@ enum BusLogic_CCB_Status ...@@ -890,82 +849,79 @@ enum BusLogic_CCB_Status
32 Logical Units per Target Device. 32 Logical Units per Target Device.
*/ */
struct BusLogic_CCB struct BusLogic_CCB {
{ /*
/* MultiMaster Firmware and FlashPoint SCCB Manager Common Portion.
MultiMaster Firmware and FlashPoint SCCB Manager Common Portion. */
*/ enum BusLogic_CCB_Opcode Opcode; /* Byte 0 */
enum BusLogic_CCB_Opcode Opcode; /* Byte 0 */ unsigned char:3; /* Byte 1 Bits 0-2 */
unsigned char :3; /* Byte 1 Bits 0-2 */ enum BusLogic_DataDirection DataDirection:2; /* Byte 1 Bits 3-4 */
enum BusLogic_DataDirection DataDirection:2; /* Byte 1 Bits 3-4 */ boolean TagEnable:1; /* Byte 1 Bit 5 */
boolean TagEnable:1; /* Byte 1 Bit 5 */ enum BusLogic_QueueTag QueueTag:2; /* Byte 1 Bits 6-7 */
enum BusLogic_QueueTag QueueTag:2; /* Byte 1 Bits 6-7 */ unsigned char CDB_Length; /* Byte 2 */
unsigned char CDB_Length; /* Byte 2 */ unsigned char SenseDataLength; /* Byte 3 */
unsigned char SenseDataLength; /* Byte 3 */ u32 DataLength; /* Bytes 4-7 */
u32 DataLength; /* Bytes 4-7 */ u32 DataPointer; /* Bytes 8-11 */
u32 DataPointer; /* Bytes 8-11 */ unsigned char:8; /* Byte 12 */
unsigned char :8; /* Byte 12 */ unsigned char:8; /* Byte 13 */
unsigned char :8; /* Byte 13 */ enum BusLogic_HostAdapterStatus HostAdapterStatus; /* Byte 14 */
enum BusLogic_HostAdapterStatus HostAdapterStatus; /* Byte 14 */ enum BusLogic_TargetDeviceStatus TargetDeviceStatus; /* Byte 15 */
enum BusLogic_TargetDeviceStatus TargetDeviceStatus; /* Byte 15 */ unsigned char TargetID; /* Byte 16 */
unsigned char TargetID; /* Byte 16 */ unsigned char LogicalUnit:5; /* Byte 17 Bits 0-4 */
unsigned char LogicalUnit:5; /* Byte 17 Bits 0-4 */ boolean LegacyTagEnable:1; /* Byte 17 Bit 5 */
boolean LegacyTagEnable:1; /* Byte 17 Bit 5 */ enum BusLogic_QueueTag LegacyQueueTag:2; /* Byte 17 Bits 6-7 */
enum BusLogic_QueueTag LegacyQueueTag:2; /* Byte 17 Bits 6-7 */ SCSI_CDB_T CDB; /* Bytes 18-29 */
SCSI_CDB_T CDB; /* Bytes 18-29 */ unsigned char:8; /* Byte 30 */
unsigned char :8; /* Byte 30 */ unsigned char:8; /* Byte 31 */
unsigned char :8; /* Byte 31 */ unsigned int:32; /* Bytes 32-35 */
unsigned int :32; /* Bytes 32-35 */ u32 SenseDataPointer; /* Bytes 36-39 */
u32 SenseDataPointer; /* Bytes 36-39 */ /*
/* FlashPoint SCCB Manager Defined Portion.
FlashPoint SCCB Manager Defined Portion. */
*/ void (*CallbackFunction) (struct BusLogic_CCB *); /* Bytes 40-43 */
void (*CallbackFunction)(struct BusLogic_CCB *); /* Bytes 40-43 */ u32 BaseAddress; /* Bytes 44-47 */
u32 BaseAddress; /* Bytes 44-47 */ enum BusLogic_CompletionCode CompletionCode; /* Byte 48 */
enum BusLogic_CompletionCode CompletionCode; /* Byte 48 */
#ifndef CONFIG_SCSI_OMIT_FLASHPOINT #ifndef CONFIG_SCSI_OMIT_FLASHPOINT
unsigned char :8; /* Byte 49 */ unsigned char:8; /* Byte 49 */
unsigned short OS_Flags; /* Bytes 50-51 */ unsigned short OS_Flags; /* Bytes 50-51 */
unsigned char Private[48]; /* Bytes 52-99 */ unsigned char Private[48]; /* Bytes 52-99 */
#endif #endif
/* /*
BusLogic Linux Driver Defined Portion. BusLogic Linux Driver Defined Portion.
*/ */
dma_addr_t AllocationGroupHead; dma_addr_t AllocationGroupHead;
unsigned int AllocationGroupSize; unsigned int AllocationGroupSize;
u32 DMA_Handle; u32 DMA_Handle;
enum BusLogic_CCB_Status Status; enum BusLogic_CCB_Status Status;
unsigned long SerialNumber; unsigned long SerialNumber;
struct scsi_cmnd *Command; struct scsi_cmnd *Command;
struct BusLogic_HostAdapter *HostAdapter; struct BusLogic_HostAdapter *HostAdapter;
struct BusLogic_CCB *Next; struct BusLogic_CCB *Next;
struct BusLogic_CCB *NextAll; struct BusLogic_CCB *NextAll;
struct BusLogic_ScatterGatherSegment struct BusLogic_ScatterGatherSegment
ScatterGatherList[BusLogic_ScatterGatherLimit]; ScatterGatherList[BusLogic_ScatterGatherLimit];
}; };
/* /*
Define the 32 Bit Mode Outgoing Mailbox structure. Define the 32 Bit Mode Outgoing Mailbox structure.
*/ */
struct BusLogic_OutgoingMailbox struct BusLogic_OutgoingMailbox {
{ u32 CCB; /* Bytes 0-3 */
u32 CCB; /* Bytes 0-3 */ unsigned int:24; /* Bytes 4-6 */
unsigned int :24; /* Bytes 4-6 */ enum BusLogic_ActionCode ActionCode; /* Byte 7 */
enum BusLogic_ActionCode ActionCode; /* Byte 7 */
}; };
/* /*
Define the 32 Bit Mode Incoming Mailbox structure. Define the 32 Bit Mode Incoming Mailbox structure.
*/ */
struct BusLogic_IncomingMailbox struct BusLogic_IncomingMailbox {
{ u32 CCB; /* Bytes 0-3 */
u32 CCB; /* Bytes 0-3 */ enum BusLogic_HostAdapterStatus HostAdapterStatus; /* Byte 4 */
enum BusLogic_HostAdapterStatus HostAdapterStatus; /* Byte 4 */ enum BusLogic_TargetDeviceStatus TargetDeviceStatus; /* Byte 5 */
enum BusLogic_TargetDeviceStatus TargetDeviceStatus; /* Byte 5 */ unsigned char:8; /* Byte 6 */
unsigned char :8; /* Byte 6 */ enum BusLogic_CompletionCode CompletionCode; /* Byte 7 */
enum BusLogic_CompletionCode CompletionCode; /* Byte 7 */
}; };
...@@ -973,29 +929,27 @@ struct BusLogic_IncomingMailbox ...@@ -973,29 +929,27 @@ struct BusLogic_IncomingMailbox
Define the BusLogic Driver Options structure. Define the BusLogic Driver Options structure.
*/ */
struct BusLogic_DriverOptions struct BusLogic_DriverOptions {
{ unsigned short TaggedQueuingPermitted;
unsigned short TaggedQueuingPermitted; unsigned short TaggedQueuingPermittedMask;
unsigned short TaggedQueuingPermittedMask; unsigned short BusSettleTime;
unsigned short BusSettleTime; struct BusLogic_LocalOptions LocalOptions;
struct BusLogic_LocalOptions LocalOptions; unsigned char CommonQueueDepth;
unsigned char CommonQueueDepth; unsigned char QueueDepth[BusLogic_MaxTargetDevices];
unsigned char QueueDepth[BusLogic_MaxTargetDevices];
}; };
/* /*
Define the Host Adapter Target Flags structure. Define the Host Adapter Target Flags structure.
*/ */
struct BusLogic_TargetFlags struct BusLogic_TargetFlags {
{ boolean TargetExists:1;
boolean TargetExists:1; boolean TaggedQueuingSupported:1;
boolean TaggedQueuingSupported:1; boolean WideTransfersSupported:1;
boolean WideTransfersSupported:1; boolean TaggedQueuingActive:1;
boolean TaggedQueuingActive:1; boolean WideTransfersActive:1;
boolean WideTransfersActive:1; boolean CommandSuccessfulFlag:1;
boolean CommandSuccessfulFlag:1; boolean TargetInfoReported:1;
boolean TargetInfoReported:1;
}; };
/* /*
...@@ -1006,25 +960,24 @@ struct BusLogic_TargetFlags ...@@ -1006,25 +960,24 @@ struct BusLogic_TargetFlags
typedef unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets]; typedef unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets];
struct BusLogic_TargetStatistics struct BusLogic_TargetStatistics {
{ unsigned int CommandsAttempted;
unsigned int CommandsAttempted; unsigned int CommandsCompleted;
unsigned int CommandsCompleted; unsigned int ReadCommands;
unsigned int ReadCommands; unsigned int WriteCommands;
unsigned int WriteCommands; struct BusLogic_ByteCounter TotalBytesRead;
struct BusLogic_ByteCounter TotalBytesRead; struct BusLogic_ByteCounter TotalBytesWritten;
struct BusLogic_ByteCounter TotalBytesWritten; BusLogic_CommandSizeBuckets_T ReadCommandSizeBuckets;
BusLogic_CommandSizeBuckets_T ReadCommandSizeBuckets; BusLogic_CommandSizeBuckets_T WriteCommandSizeBuckets;
BusLogic_CommandSizeBuckets_T WriteCommandSizeBuckets; unsigned short CommandAbortsRequested;
unsigned short CommandAbortsRequested; unsigned short CommandAbortsAttempted;
unsigned short CommandAbortsAttempted; unsigned short CommandAbortsCompleted;
unsigned short CommandAbortsCompleted; unsigned short BusDeviceResetsRequested;
unsigned short BusDeviceResetsRequested; unsigned short BusDeviceResetsAttempted;
unsigned short BusDeviceResetsAttempted; unsigned short BusDeviceResetsCompleted;
unsigned short BusDeviceResetsCompleted; unsigned short HostAdapterResetsRequested;
unsigned short HostAdapterResetsRequested; unsigned short HostAdapterResetsAttempted;
unsigned short HostAdapterResetsAttempted; unsigned short HostAdapterResetsCompleted;
unsigned short HostAdapterResetsCompleted;
}; };
/* /*
...@@ -1041,183 +994,179 @@ typedef unsigned int FlashPoint_CardHandle_T; ...@@ -1041,183 +994,179 @@ typedef unsigned int FlashPoint_CardHandle_T;
by the FlashPoint SCCB Manager. by the FlashPoint SCCB Manager.
*/ */
struct FlashPoint_Info struct FlashPoint_Info {
{ u32 BaseAddress; /* Bytes 0-3 */
u32 BaseAddress; /* Bytes 0-3 */ boolean Present; /* Byte 4 */
boolean Present; /* Byte 4 */ unsigned char IRQ_Channel; /* Byte 5 */
unsigned char IRQ_Channel; /* Byte 5 */ unsigned char SCSI_ID; /* Byte 6 */
unsigned char SCSI_ID; /* Byte 6 */ unsigned char SCSI_LUN; /* Byte 7 */
unsigned char SCSI_LUN; /* Byte 7 */ unsigned short FirmwareRevision; /* Bytes 8-9 */
unsigned short FirmwareRevision; /* Bytes 8-9 */ unsigned short SynchronousPermitted; /* Bytes 10-11 */
unsigned short SynchronousPermitted; /* Bytes 10-11 */ unsigned short FastPermitted; /* Bytes 12-13 */
unsigned short FastPermitted; /* Bytes 12-13 */ unsigned short UltraPermitted; /* Bytes 14-15 */
unsigned short UltraPermitted; /* Bytes 14-15 */ unsigned short DisconnectPermitted; /* Bytes 16-17 */
unsigned short DisconnectPermitted; /* Bytes 16-17 */ unsigned short WidePermitted; /* Bytes 18-19 */
unsigned short WidePermitted; /* Bytes 18-19 */ boolean ParityCheckingEnabled:1; /* Byte 20 Bit 0 */
boolean ParityCheckingEnabled:1; /* Byte 20 Bit 0 */ boolean HostWideSCSI:1; /* Byte 20 Bit 1 */
boolean HostWideSCSI:1; /* Byte 20 Bit 1 */ boolean HostSoftReset:1; /* Byte 20 Bit 2 */
boolean HostSoftReset:1; /* Byte 20 Bit 2 */ boolean ExtendedTranslationEnabled:1; /* Byte 20 Bit 3 */
boolean ExtendedTranslationEnabled:1; /* Byte 20 Bit 3 */ boolean LowByteTerminated:1; /* Byte 20 Bit 4 */
boolean LowByteTerminated:1; /* Byte 20 Bit 4 */ boolean HighByteTerminated:1; /* Byte 20 Bit 5 */
boolean HighByteTerminated:1; /* Byte 20 Bit 5 */ boolean ReportDataUnderrun:1; /* Byte 20 Bit 6 */
boolean ReportDataUnderrun:1; /* Byte 20 Bit 6 */ boolean SCAM_Enabled:1; /* Byte 20 Bit 7 */
boolean SCAM_Enabled:1; /* Byte 20 Bit 7 */ boolean SCAM_Level2:1; /* Byte 21 Bit 0 */
boolean SCAM_Level2:1; /* Byte 21 Bit 0 */ unsigned char:7; /* Byte 21 Bits 1-7 */
unsigned char :7; /* Byte 21 Bits 1-7 */ unsigned char Family; /* Byte 22 */
unsigned char Family; /* Byte 22 */ unsigned char BusType; /* Byte 23 */
unsigned char BusType; /* Byte 23 */ unsigned char ModelNumber[3]; /* Bytes 24-26 */
unsigned char ModelNumber[3]; /* Bytes 24-26 */ unsigned char RelativeCardNumber; /* Byte 27 */
unsigned char RelativeCardNumber; /* Byte 27 */ unsigned char Reserved[4]; /* Bytes 28-31 */
unsigned char Reserved[4]; /* Bytes 28-31 */ unsigned int OS_Reserved; /* Bytes 32-35 */
unsigned int OS_Reserved; /* Bytes 32-35 */ unsigned char TranslationInfo[4]; /* Bytes 36-39 */
unsigned char TranslationInfo[4]; /* Bytes 36-39 */ unsigned int Reserved2[5]; /* Bytes 40-59 */
unsigned int Reserved2[5]; /* Bytes 40-59 */ unsigned int SecondaryRange; /* Bytes 60-63 */
unsigned int SecondaryRange; /* Bytes 60-63 */
}; };
/* /*
Define the BusLogic Driver Host Adapter structure. Define the BusLogic Driver Host Adapter structure.
*/ */
struct BusLogic_HostAdapter struct BusLogic_HostAdapter {
{ struct Scsi_Host *SCSI_Host;
struct Scsi_Host *SCSI_Host; struct pci_dev *PCI_Device;
struct pci_dev *PCI_Device; enum BusLogic_HostAdapterType HostAdapterType;
enum BusLogic_HostAdapterType HostAdapterType; enum BusLogic_HostAdapterBusType HostAdapterBusType;
enum BusLogic_HostAdapterBusType HostAdapterBusType; unsigned long IO_Address;
unsigned long IO_Address; unsigned long PCI_Address;
unsigned long PCI_Address; unsigned short AddressCount;
unsigned short AddressCount; unsigned char HostNumber;
unsigned char HostNumber; unsigned char ModelName[9];
unsigned char ModelName[9]; unsigned char FirmwareVersion[6];
unsigned char FirmwareVersion[6]; unsigned char FullModelName[18];
unsigned char FullModelName[18]; unsigned char Bus;
unsigned char Bus; unsigned char Device;
unsigned char Device; unsigned char IRQ_Channel;
unsigned char IRQ_Channel; unsigned char DMA_Channel;
unsigned char DMA_Channel; unsigned char SCSI_ID;
unsigned char SCSI_ID; boolean IRQ_ChannelAcquired:1;
boolean IRQ_ChannelAcquired:1; boolean DMA_ChannelAcquired:1;
boolean DMA_ChannelAcquired:1; boolean ExtendedTranslationEnabled:1;
boolean ExtendedTranslationEnabled:1; boolean ParityCheckingEnabled:1;
boolean ParityCheckingEnabled:1; boolean BusResetEnabled:1;
boolean BusResetEnabled:1; boolean LevelSensitiveInterrupt:1;
boolean LevelSensitiveInterrupt:1; boolean HostWideSCSI:1;
boolean HostWideSCSI:1; boolean HostDifferentialSCSI:1;
boolean HostDifferentialSCSI:1; boolean HostSupportsSCAM:1;
boolean HostSupportsSCAM:1; boolean HostUltraSCSI:1;
boolean HostUltraSCSI:1; boolean ExtendedLUNSupport:1;
boolean ExtendedLUNSupport:1; boolean TerminationInfoValid:1;
boolean TerminationInfoValid:1; boolean LowByteTerminated:1;
boolean LowByteTerminated:1; boolean HighByteTerminated:1;
boolean HighByteTerminated:1; boolean BounceBuffersRequired:1;
boolean BounceBuffersRequired:1; boolean StrictRoundRobinModeSupport:1;
boolean StrictRoundRobinModeSupport:1; boolean SCAM_Enabled:1;
boolean SCAM_Enabled:1; boolean SCAM_Level2:1;
boolean SCAM_Level2:1; boolean HostAdapterInitialized:1;
boolean HostAdapterInitialized:1; boolean HostAdapterExternalReset:1;
boolean HostAdapterExternalReset:1; boolean HostAdapterInternalError:1;
boolean HostAdapterInternalError:1; boolean ProcessCompletedCCBsActive;
boolean ProcessCompletedCCBsActive; volatile boolean HostAdapterCommandCompleted;
volatile boolean HostAdapterCommandCompleted; unsigned short HostAdapterScatterGatherLimit;
unsigned short HostAdapterScatterGatherLimit; unsigned short DriverScatterGatherLimit;
unsigned short DriverScatterGatherLimit; unsigned short MaxTargetDevices;
unsigned short MaxTargetDevices; unsigned short MaxLogicalUnits;
unsigned short MaxLogicalUnits; unsigned short MailboxCount;
unsigned short MailboxCount; unsigned short InitialCCBs;
unsigned short InitialCCBs; unsigned short IncrementalCCBs;
unsigned short IncrementalCCBs; unsigned short AllocatedCCBs;
unsigned short AllocatedCCBs; unsigned short DriverQueueDepth;
unsigned short DriverQueueDepth; unsigned short HostAdapterQueueDepth;
unsigned short HostAdapterQueueDepth; unsigned short UntaggedQueueDepth;
unsigned short UntaggedQueueDepth; unsigned short CommonQueueDepth;
unsigned short CommonQueueDepth; unsigned short BusSettleTime;
unsigned short BusSettleTime; unsigned short SynchronousPermitted;
unsigned short SynchronousPermitted; unsigned short FastPermitted;
unsigned short FastPermitted; unsigned short UltraPermitted;
unsigned short UltraPermitted; unsigned short WidePermitted;
unsigned short WidePermitted; unsigned short DisconnectPermitted;
unsigned short DisconnectPermitted; unsigned short TaggedQueuingPermitted;
unsigned short TaggedQueuingPermitted; unsigned short ExternalHostAdapterResets;
unsigned short ExternalHostAdapterResets; unsigned short HostAdapterInternalErrors;
unsigned short HostAdapterInternalErrors; unsigned short TargetDeviceCount;
unsigned short TargetDeviceCount; unsigned short MessageBufferLength;
unsigned short MessageBufferLength; u32 BIOS_Address;
u32 BIOS_Address; struct BusLogic_DriverOptions *DriverOptions;
struct BusLogic_DriverOptions *DriverOptions; struct FlashPoint_Info FlashPointInfo;
struct FlashPoint_Info FlashPointInfo; FlashPoint_CardHandle_T CardHandle;
FlashPoint_CardHandle_T CardHandle; struct BusLogic_HostAdapter *Next;
struct BusLogic_HostAdapter *Next; struct BusLogic_CCB *All_CCBs;
struct BusLogic_CCB *All_CCBs; struct BusLogic_CCB *Free_CCBs;
struct BusLogic_CCB *Free_CCBs; struct BusLogic_CCB *FirstCompletedCCB;
struct BusLogic_CCB *FirstCompletedCCB; struct BusLogic_CCB *LastCompletedCCB;
struct BusLogic_CCB *LastCompletedCCB; struct BusLogic_CCB *BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices];
struct BusLogic_CCB *BusDeviceResetPendingCCB[BusLogic_MaxTargetDevices]; struct BusLogic_TargetFlags TargetFlags[BusLogic_MaxTargetDevices];
struct BusLogic_TargetFlags TargetFlags[BusLogic_MaxTargetDevices]; unsigned char QueueDepth[BusLogic_MaxTargetDevices];
unsigned char QueueDepth[BusLogic_MaxTargetDevices]; unsigned char SynchronousPeriod[BusLogic_MaxTargetDevices];
unsigned char SynchronousPeriod[BusLogic_MaxTargetDevices]; unsigned char SynchronousOffset[BusLogic_MaxTargetDevices];
unsigned char SynchronousOffset[BusLogic_MaxTargetDevices]; unsigned char ActiveCommands[BusLogic_MaxTargetDevices];
unsigned char ActiveCommands[BusLogic_MaxTargetDevices]; unsigned int CommandsSinceReset[BusLogic_MaxTargetDevices];
unsigned int CommandsSinceReset[BusLogic_MaxTargetDevices]; unsigned long LastSequencePoint[BusLogic_MaxTargetDevices];
unsigned long LastSequencePoint[BusLogic_MaxTargetDevices]; unsigned long LastResetAttempted[BusLogic_MaxTargetDevices];
unsigned long LastResetAttempted[BusLogic_MaxTargetDevices]; unsigned long LastResetCompleted[BusLogic_MaxTargetDevices];
unsigned long LastResetCompleted[BusLogic_MaxTargetDevices]; struct BusLogic_OutgoingMailbox *FirstOutgoingMailbox;
struct BusLogic_OutgoingMailbox *FirstOutgoingMailbox; struct BusLogic_OutgoingMailbox *LastOutgoingMailbox;
struct BusLogic_OutgoingMailbox *LastOutgoingMailbox; struct BusLogic_OutgoingMailbox *NextOutgoingMailbox;
struct BusLogic_OutgoingMailbox *NextOutgoingMailbox; struct BusLogic_IncomingMailbox *FirstIncomingMailbox;
struct BusLogic_IncomingMailbox *FirstIncomingMailbox; struct BusLogic_IncomingMailbox *LastIncomingMailbox;
struct BusLogic_IncomingMailbox *LastIncomingMailbox; struct BusLogic_IncomingMailbox *NextIncomingMailbox;
struct BusLogic_IncomingMailbox *NextIncomingMailbox; struct BusLogic_TargetStatistics TargetStatistics[BusLogic_MaxTargetDevices];
struct BusLogic_TargetStatistics TargetStatistics[BusLogic_MaxTargetDevices]; unsigned char *MailboxSpace;
unsigned char *MailboxSpace; dma_addr_t MailboxSpaceHandle;
dma_addr_t MailboxSpaceHandle; unsigned int MailboxSize;
unsigned int MailboxSize; unsigned long CCB_Offset;
unsigned long CCB_Offset; char MessageBuffer[BusLogic_MessageBufferSize];
char MessageBuffer[BusLogic_MessageBufferSize];
}; };
/* /*
Define a structure for the BIOS Disk Parameters. Define a structure for the BIOS Disk Parameters.
*/ */
struct BIOS_DiskParameters struct BIOS_DiskParameters {
{ int Heads;
int Heads; int Sectors;
int Sectors; int Cylinders;
int Cylinders;
}; };
/* /*
Define a structure for the SCSI Inquiry command results. Define a structure for the SCSI Inquiry command results.
*/ */
struct SCSI_Inquiry struct SCSI_Inquiry {
{ unsigned char PeripheralDeviceType:5; /* Byte 0 Bits 0-4 */
unsigned char PeripheralDeviceType:5; /* Byte 0 Bits 0-4 */ unsigned char PeripheralQualifier:3; /* Byte 0 Bits 5-7 */
unsigned char PeripheralQualifier:3; /* Byte 0 Bits 5-7 */ unsigned char DeviceTypeModifier:7; /* Byte 1 Bits 0-6 */
unsigned char DeviceTypeModifier:7; /* Byte 1 Bits 0-6 */ boolean RMB:1; /* Byte 1 Bit 7 */
boolean RMB:1; /* Byte 1 Bit 7 */ unsigned char ANSI_ApprovedVersion:3; /* Byte 2 Bits 0-2 */
unsigned char ANSI_ApprovedVersion:3; /* Byte 2 Bits 0-2 */ unsigned char ECMA_Version:3; /* Byte 2 Bits 3-5 */
unsigned char ECMA_Version:3; /* Byte 2 Bits 3-5 */ unsigned char ISO_Version:2; /* Byte 2 Bits 6-7 */
unsigned char ISO_Version:2; /* Byte 2 Bits 6-7 */ unsigned char ResponseDataFormat:4; /* Byte 3 Bits 0-3 */
unsigned char ResponseDataFormat:4; /* Byte 3 Bits 0-3 */ unsigned char:2; /* Byte 3 Bits 4-5 */
unsigned char :2; /* Byte 3 Bits 4-5 */ boolean TrmIOP:1; /* Byte 3 Bit 6 */
boolean TrmIOP:1; /* Byte 3 Bit 6 */ boolean AENC:1; /* Byte 3 Bit 7 */
boolean AENC:1; /* Byte 3 Bit 7 */ unsigned char AdditionalLength; /* Byte 4 */
unsigned char AdditionalLength; /* Byte 4 */ unsigned char:8; /* Byte 5 */
unsigned char :8; /* Byte 5 */ unsigned char:8; /* Byte 6 */
unsigned char :8; /* Byte 6 */ boolean SftRe:1; /* Byte 7 Bit 0 */
boolean SftRe:1; /* Byte 7 Bit 0 */ boolean CmdQue:1; /* Byte 7 Bit 1 */
boolean CmdQue:1; /* Byte 7 Bit 1 */ boolean:1; /* Byte 7 Bit 2 */
boolean :1; /* Byte 7 Bit 2 */ boolean Linked:1; /* Byte 7 Bit 3 */
boolean Linked:1; /* Byte 7 Bit 3 */ boolean Sync:1; /* Byte 7 Bit 4 */
boolean Sync:1; /* Byte 7 Bit 4 */ boolean WBus16:1; /* Byte 7 Bit 5 */
boolean WBus16:1; /* Byte 7 Bit 5 */ boolean WBus32:1; /* Byte 7 Bit 6 */
boolean WBus32:1; /* Byte 7 Bit 6 */ boolean RelAdr:1; /* Byte 7 Bit 7 */
boolean RelAdr:1; /* Byte 7 Bit 7 */ unsigned char VendorIdentification[8]; /* Bytes 8-15 */
unsigned char VendorIdentification[8]; /* Bytes 8-15 */ unsigned char ProductIdentification[16]; /* Bytes 16-31 */
unsigned char ProductIdentification[16]; /* Bytes 16-31 */ unsigned char ProductRevisionLevel[4]; /* Bytes 32-35 */
unsigned char ProductRevisionLevel[4]; /* Bytes 32-35 */
}; };
/* /*
...@@ -1226,7 +1175,7 @@ struct SCSI_Inquiry ...@@ -1226,7 +1175,7 @@ struct SCSI_Inquiry
static inline void BusLogic_AcquireHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter) static inline void BusLogic_AcquireHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter)
{ {
spin_lock_irq(HostAdapter->SCSI_Host->host_lock); spin_lock_irq(HostAdapter->SCSI_Host->host_lock);
} }
/* /*
...@@ -1235,7 +1184,7 @@ static inline void BusLogic_AcquireHostAdapterLock(struct BusLogic_HostAdapter * ...@@ -1235,7 +1184,7 @@ static inline void BusLogic_AcquireHostAdapterLock(struct BusLogic_HostAdapter *
static inline void BusLogic_ReleaseHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter) static inline void BusLogic_ReleaseHostAdapterLock(struct BusLogic_HostAdapter *HostAdapter)
{ {
spin_unlock_irq(HostAdapter->SCSI_Host->host_lock); spin_unlock_irq(HostAdapter->SCSI_Host->host_lock);
} }
...@@ -1244,10 +1193,9 @@ static inline void BusLogic_ReleaseHostAdapterLock(struct BusLogic_HostAdapter * ...@@ -1244,10 +1193,9 @@ static inline void BusLogic_ReleaseHostAdapterLock(struct BusLogic_HostAdapter *
but is only called from the interrupt handler. but is only called from the interrupt handler.
*/ */
static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, unsigned long *ProcessorFlags)
unsigned long *ProcessorFlags)
{ {
spin_lock_irqsave(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags); spin_lock_irqsave(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);
} }
...@@ -1256,10 +1204,9 @@ static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter ...@@ -1256,10 +1204,9 @@ static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter
but is only called from the interrupt handler. but is only called from the interrupt handler.
*/ */
static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, unsigned long *ProcessorFlags)
unsigned long *ProcessorFlags)
{ {
spin_unlock_irqrestore(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags); spin_unlock_irqrestore(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);
} }
...@@ -1270,65 +1217,60 @@ static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter ...@@ -1270,65 +1217,60 @@ static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter
static inline void BusLogic_SCSIBusReset(struct BusLogic_HostAdapter *HostAdapter) static inline void BusLogic_SCSIBusReset(struct BusLogic_HostAdapter *HostAdapter)
{ {
union BusLogic_ControlRegister ControlRegister; union BusLogic_ControlRegister ControlRegister;
ControlRegister.All = 0; ControlRegister.All = 0;
ControlRegister.cr.SCSIBusReset = true; ControlRegister.cr.SCSIBusReset = true;
outb(ControlRegister.All, outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
} }
static inline void BusLogic_InterruptReset(struct BusLogic_HostAdapter *HostAdapter) static inline void BusLogic_InterruptReset(struct BusLogic_HostAdapter *HostAdapter)
{ {
union BusLogic_ControlRegister ControlRegister; union BusLogic_ControlRegister ControlRegister;
ControlRegister.All = 0; ControlRegister.All = 0;
ControlRegister.cr.InterruptReset = true; ControlRegister.cr.InterruptReset = true;
outb(ControlRegister.All, outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
} }
static inline void BusLogic_SoftReset(struct BusLogic_HostAdapter *HostAdapter) static inline void BusLogic_SoftReset(struct BusLogic_HostAdapter *HostAdapter)
{ {
union BusLogic_ControlRegister ControlRegister; union BusLogic_ControlRegister ControlRegister;
ControlRegister.All = 0; ControlRegister.All = 0;
ControlRegister.cr.SoftReset = true; ControlRegister.cr.SoftReset = true;
outb(ControlRegister.All, outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
} }
static inline void BusLogic_HardReset(struct BusLogic_HostAdapter *HostAdapter) static inline void BusLogic_HardReset(struct BusLogic_HostAdapter *HostAdapter)
{ {
union BusLogic_ControlRegister ControlRegister; union BusLogic_ControlRegister ControlRegister;
ControlRegister.All = 0; ControlRegister.All = 0;
ControlRegister.cr.HardReset = true; ControlRegister.cr.HardReset = true;
outb(ControlRegister.All, outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
} }
static inline unsigned char BusLogic_ReadStatusRegister(struct BusLogic_HostAdapter *HostAdapter) static inline unsigned char BusLogic_ReadStatusRegister(struct BusLogic_HostAdapter *HostAdapter)
{ {
return inb(HostAdapter->IO_Address + BusLogic_StatusRegisterOffset); return inb(HostAdapter->IO_Address + BusLogic_StatusRegisterOffset);
} }
static inline void BusLogic_WriteCommandParameterRegister(struct BusLogic_HostAdapter static inline void BusLogic_WriteCommandParameterRegister(struct BusLogic_HostAdapter
*HostAdapter, *HostAdapter, unsigned char Value)
unsigned char Value)
{ {
outb(Value, HostAdapter->IO_Address + BusLogic_CommandParameterRegisterOffset); outb(Value, HostAdapter->IO_Address + BusLogic_CommandParameterRegisterOffset);
} }
static inline unsigned char BusLogic_ReadDataInRegister(struct BusLogic_HostAdapter *HostAdapter) static inline unsigned char BusLogic_ReadDataInRegister(struct BusLogic_HostAdapter *HostAdapter)
{ {
return inb(HostAdapter->IO_Address + BusLogic_DataInRegisterOffset); return inb(HostAdapter->IO_Address + BusLogic_DataInRegisterOffset);
} }
static inline unsigned char BusLogic_ReadInterruptRegister(struct BusLogic_HostAdapter *HostAdapter) static inline unsigned char BusLogic_ReadInterruptRegister(struct BusLogic_HostAdapter *HostAdapter)
{ {
return inb(HostAdapter->IO_Address + BusLogic_InterruptRegisterOffset); return inb(HostAdapter->IO_Address + BusLogic_InterruptRegisterOffset);
} }
static inline unsigned char BusLogic_ReadGeometryRegister(struct BusLogic_HostAdapter *HostAdapter) static inline unsigned char BusLogic_ReadGeometryRegister(struct BusLogic_HostAdapter *HostAdapter)
{ {
return inb(HostAdapter->IO_Address + BusLogic_GeometryRegisterOffset); return inb(HostAdapter->IO_Address + BusLogic_GeometryRegisterOffset);
} }
/* /*
...@@ -1339,7 +1281,7 @@ static inline unsigned char BusLogic_ReadGeometryRegister(struct BusLogic_HostAd ...@@ -1339,7 +1281,7 @@ static inline unsigned char BusLogic_ReadGeometryRegister(struct BusLogic_HostAd
static inline void BusLogic_StartMailboxCommand(struct BusLogic_HostAdapter *HostAdapter) static inline void BusLogic_StartMailboxCommand(struct BusLogic_HostAdapter *HostAdapter)
{ {
BusLogic_WriteCommandParameterRegister(HostAdapter, BusLogic_ExecuteMailboxCommand); BusLogic_WriteCommandParameterRegister(HostAdapter, BusLogic_ExecuteMailboxCommand);
} }
/* /*
...@@ -1348,7 +1290,7 @@ static inline void BusLogic_StartMailboxCommand(struct BusLogic_HostAdapter *Hos ...@@ -1348,7 +1290,7 @@ static inline void BusLogic_StartMailboxCommand(struct BusLogic_HostAdapter *Hos
static inline void BusLogic_Delay(int Seconds) static inline void BusLogic_Delay(int Seconds)
{ {
mdelay(1000 * Seconds); mdelay(1000 * Seconds);
} }
/* /*
...@@ -1358,12 +1300,12 @@ static inline void BusLogic_Delay(int Seconds) ...@@ -1358,12 +1300,12 @@ static inline void BusLogic_Delay(int Seconds)
static inline u32 Virtual_to_Bus(void *VirtualAddress) static inline u32 Virtual_to_Bus(void *VirtualAddress)
{ {
return (u32) virt_to_bus(VirtualAddress); return (u32) virt_to_bus(VirtualAddress);
} }
static inline void *Bus_to_Virtual(u32 BusAddress) static inline void *Bus_to_Virtual(u32 BusAddress)
{ {
return (void *) bus_to_virt(BusAddress); return (void *) bus_to_virt(BusAddress);
} }
/* /*
...@@ -1374,7 +1316,7 @@ static inline void *Bus_to_Virtual(u32 BusAddress) ...@@ -1374,7 +1316,7 @@ static inline void *Bus_to_Virtual(u32 BusAddress)
static inline u32 Virtual_to_32Bit_Virtual(void *VirtualAddress) static inline u32 Virtual_to_32Bit_Virtual(void *VirtualAddress)
{ {
return (u32) (unsigned long) VirtualAddress; return (u32) (unsigned long) VirtualAddress;
} }
/* /*
...@@ -1384,7 +1326,8 @@ static inline u32 Virtual_to_32Bit_Virtual(void *VirtualAddress) ...@@ -1384,7 +1326,8 @@ static inline u32 Virtual_to_32Bit_Virtual(void *VirtualAddress)
static inline void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter) static inline void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter)
{ {
if (*ErrorCounter < 65535) (*ErrorCounter)++; if (*ErrorCounter < 65535)
(*ErrorCounter)++;
} }
/* /*
...@@ -1392,40 +1335,35 @@ static inline void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter) ...@@ -1392,40 +1335,35 @@ static inline void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter)
*/ */
static inline void BusLogic_IncrementByteCounter(struct BusLogic_ByteCounter static inline void BusLogic_IncrementByteCounter(struct BusLogic_ByteCounter
*ByteCounter, *ByteCounter, unsigned int Amount)
unsigned int Amount)
{ {
ByteCounter->Units += Amount; ByteCounter->Units += Amount;
if (ByteCounter->Units > 999999999) if (ByteCounter->Units > 999999999) {
{ ByteCounter->Units -= 1000000000;
ByteCounter->Units -= 1000000000; ByteCounter->Billions++;
ByteCounter->Billions++; }
}
} }
/* /*
BusLogic_IncrementSizeBucket increments the Bucket for Amount. BusLogic_IncrementSizeBucket increments the Bucket for Amount.
*/ */
static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T CommandSizeBuckets, unsigned int Amount)
CommandSizeBuckets, {
unsigned int Amount) int Index = 0;
{ if (Amount < 8 * 1024) {
int Index = 0; if (Amount < 2 * 1024)
if (Amount < 8*1024) Index = (Amount < 1 * 1024 ? 0 : 1);
{ else
if (Amount < 2*1024) Index = (Amount < 4 * 1024 ? 2 : 3);
Index = (Amount < 1*1024 ? 0 : 1); } else if (Amount < 128 * 1024) {
else Index = (Amount < 4*1024 ? 2 : 3); if (Amount < 32 * 1024)
} Index = (Amount < 16 * 1024 ? 4 : 5);
else if (Amount < 128*1024) else
{ Index = (Amount < 64 * 1024 ? 6 : 7);
if (Amount < 32*1024) } else
Index = (Amount < 16*1024 ? 4 : 5); Index = (Amount < 256 * 1024 ? 8 : 9);
else Index = (Amount < 64*1024 ? 6 : 7); CommandSizeBuckets[Index]++;
}
else Index = (Amount < 256*1024 ? 8 : 9);
CommandSizeBuckets[Index]++;
} }
/* /*
...@@ -1450,20 +1388,14 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T ...@@ -1450,20 +1388,14 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T
static const char *BusLogic_DriverInfo(struct Scsi_Host *); static const char *BusLogic_DriverInfo(struct Scsi_Host *);
static int BusLogic_DetectHostAdapter(struct scsi_host_template *); static int BusLogic_DetectHostAdapter(struct scsi_host_template *);
static int BusLogic_ReleaseHostAdapter(struct Scsi_Host *); static int BusLogic_ReleaseHostAdapter(struct Scsi_Host *);
static int BusLogic_QueueCommand(struct scsi_cmnd *, static int BusLogic_QueueCommand(struct scsi_cmnd *, void (*CompletionRoutine) (struct scsi_cmnd *));
void (*CompletionRoutine)(struct scsi_cmnd *)); static int BusLogic_BIOSDiskParameters(struct scsi_device *, struct block_device *, sector_t, int *);
static int BusLogic_BIOSDiskParameters(struct scsi_device *, static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *, char **, off_t, int, int);
struct block_device *,
sector_t, int *);
static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *,
char **, off_t, int, int);
static int BusLogic_SlaveConfigure(struct scsi_device *); static int BusLogic_SlaveConfigure(struct scsi_device *);
static void BusLogic_QueueCompletedCCB(struct BusLogic_CCB *); static void BusLogic_QueueCompletedCCB(struct BusLogic_CCB *);
static irqreturn_t BusLogic_InterruptHandler(int, void *, struct pt_regs *); static irqreturn_t BusLogic_InterruptHandler(int, void *, struct pt_regs *);
static int BusLogic_ResetHostAdapter(struct BusLogic_HostAdapter *, static int BusLogic_ResetHostAdapter(struct BusLogic_HostAdapter *, boolean HardReset);
boolean HardReset); static void BusLogic_Message(enum BusLogic_MessageLevel, char *, struct BusLogic_HostAdapter *, ...);
static void BusLogic_Message(enum BusLogic_MessageLevel, char *,
struct BusLogic_HostAdapter *, ...);
static int __init BusLogic_Setup(char *); static int __init BusLogic_Setup(char *);
#endif /* _BUSLOGIC_H */ #endif /* _BUSLOGIC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment