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,8 +128,7 @@
Define the Driver Message Levels.
*/
enum BusLogic_MessageLevel
{
enum BusLogic_MessageLevel {
BusLogic_AnnounceLevel = 0,
BusLogic_InfoLevel = 1,
BusLogic_NoticeLevel = 2,
......@@ -137,8 +136,7 @@ enum BusLogic_MessageLevel
BusLogic_ErrorLevel = 4
};
static char *BusLogic_MessageLevelMap[] =
{ KERN_NOTICE, KERN_NOTICE, KERN_NOTICE, KERN_WARNING, KERN_ERR };
static char *BusLogic_MessageLevelMap[] = { KERN_NOTICE, KERN_NOTICE, KERN_NOTICE, KERN_WARNING, KERN_ERR };
/*
......@@ -166,8 +164,7 @@ static char *BusLogic_MessageLevelMap[] =
of I/O Addresses required by each type.
*/
enum BusLogic_HostAdapterType
{
enum BusLogic_HostAdapterType {
BusLogic_MultiMaster = 1,
BusLogic_FlashPoint = 2
} PACKED;
......@@ -175,8 +172,7 @@ enum BusLogic_HostAdapterType
#define BusLogic_MultiMasterAddressCount 4
#define BusLogic_FlashPointAddressCount 256
static int BusLogic_HostAdapterAddressCount[3] =
{ 0, BusLogic_MultiMasterAddressCount, BusLogic_FlashPointAddressCount };
static int BusLogic_HostAdapterAddressCount[3] = { 0, BusLogic_MultiMasterAddressCount, BusLogic_FlashPointAddressCount };
/*
......@@ -206,8 +202,7 @@ static int BusLogic_HostAdapterAddressCount[3] =
Define the possible Host Adapter Bus Types.
*/
enum BusLogic_HostAdapterBusType
{
enum BusLogic_HostAdapterBusType {
BusLogic_Unknown_Bus = 0,
BusLogic_ISA_Bus = 1,
BusLogic_EISA_Bus = 2,
......@@ -216,11 +211,9 @@ enum BusLogic_HostAdapterBusType
BusLogic_MCA_Bus = 5
} PACKED;
static char *BusLogic_HostAdapterBusNames[] =
{ "Unknown", "ISA", "EISA", "PCI", "VESA", "MCA" };
static char *BusLogic_HostAdapterBusNames[] = { "Unknown", "ISA", "EISA", "PCI", "VESA", "MCA" };
static enum BusLogic_HostAdapterBusType BusLogic_HostAdapterBusTypes[] =
{
static enum BusLogic_HostAdapterBusType BusLogic_HostAdapterBusTypes[] = {
BusLogic_VESA_Bus, /* BT-4xx */
BusLogic_ISA_Bus, /* BT-5xx */
BusLogic_MCA_Bus, /* BT-6xx */
......@@ -233,8 +226,7 @@ static enum BusLogic_HostAdapterBusType BusLogic_HostAdapterBusTypes[] =
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_Installed_64x32 = 1,
BusLogic_BIOS_Disk_Installed_128x32 = 2,
......@@ -255,8 +247,7 @@ typedef enum {
Define a 10^18 Statistics Byte Counter data type.
*/
struct BusLogic_ByteCounter
{
struct BusLogic_ByteCounter {
unsigned int Units;
unsigned int Billions;
};
......@@ -266,8 +257,7 @@ struct BusLogic_ByteCounter
Define the structure for I/O Address and Bus Probing Information.
*/
struct BusLogic_ProbeInfo
{
struct BusLogic_ProbeInfo {
enum BusLogic_HostAdapterType HostAdapterType;
enum BusLogic_HostAdapterBusType HostAdapterBusType;
unsigned long IO_Address;
......@@ -282,8 +272,7 @@ struct BusLogic_ProbeInfo
Define the Probe Options.
*/
struct BusLogic_ProbeOptions
{
struct BusLogic_ProbeOptions {
boolean NoProbe:1; /* Bit 0 */
boolean NoProbeISA:1; /* Bit 1 */
boolean NoProbePCI:1; /* Bit 2 */
......@@ -303,8 +292,7 @@ struct BusLogic_ProbeOptions
Define the Global Options.
*/
struct BusLogic_GlobalOptions
{
struct BusLogic_GlobalOptions {
boolean TraceProbe:1; /* Bit 0 */
boolean TraceHardwareReset:1; /* Bit 1 */
boolean TraceConfiguration:1; /* Bit 2 */
......@@ -315,8 +303,7 @@ struct BusLogic_GlobalOptions
Define the Local Options.
*/
struct BusLogic_LocalOptions
{
struct BusLogic_LocalOptions {
boolean InhibitTargetInquiry:1; /* Bit 0 */
};
......@@ -335,11 +322,10 @@ struct BusLogic_LocalOptions
Define the structure of the write-only Control Register.
*/
union BusLogic_ControlRegister
{
union BusLogic_ControlRegister {
unsigned char All;
struct {
unsigned char :4; /* Bits 0-3 */
unsigned char:4; /* Bits 0-3 */
boolean SCSIBusReset:1; /* Bit 4 */
boolean InterruptReset:1; /* Bit 5 */
boolean SoftReset:1; /* Bit 6 */
......@@ -351,8 +337,7 @@ union BusLogic_ControlRegister
Define the structure of the read-only Status Register.
*/
union BusLogic_StatusRegister
{
union BusLogic_StatusRegister {
unsigned char All;
struct {
boolean CommandInvalid:1; /* Bit 0 */
......@@ -370,8 +355,7 @@ union BusLogic_StatusRegister
Define the structure of the read-only Interrupt Register.
*/
union BusLogic_InterruptRegister
{
union BusLogic_InterruptRegister {
unsigned char All;
struct {
boolean IncomingMailboxLoaded:1; /* Bit 0 */
......@@ -387,13 +371,12 @@ union BusLogic_InterruptRegister
Define the structure of the read-only Geometry Register.
*/
union BusLogic_GeometryRegister
{
union BusLogic_GeometryRegister {
unsigned char All;
struct {
enum BusLogic_BIOS_DiskGeometryTranslation Drive0Geometry:2;/* Bits 0-1 */
enum BusLogic_BIOS_DiskGeometryTranslation Drive1Geometry:2;/* Bits 2-3 */
unsigned char :3; /* Bits 4-6 */
enum BusLogic_BIOS_DiskGeometryTranslation Drive0Geometry:2; /* Bits 0-1 */
enum BusLogic_BIOS_DiskGeometryTranslation Drive1Geometry:2; /* Bits 2-3 */
unsigned char:3; /* Bits 4-6 */
boolean ExtendedTranslationEnabled:1; /* Bit 7 */
} gr;
};
......@@ -402,8 +385,7 @@ union BusLogic_GeometryRegister
Define the BusLogic SCSI Host Adapter Command Register Operation Codes.
*/
enum BusLogic_OperationCode
{
enum BusLogic_OperationCode {
BusLogic_TestCommandCompleteInterrupt = 0x00,
BusLogic_InitializeMailbox = 0x01,
BusLogic_ExecuteMailboxCommand = 0x02,
......@@ -454,8 +436,7 @@ enum BusLogic_OperationCode
Define the Inquire Board ID reply structure.
*/
struct BusLogic_BoardID
{
struct BusLogic_BoardID {
unsigned char BoardType; /* Byte 0 */
unsigned char CustomFeatures; /* Byte 1 */
unsigned char FirmwareVersion1stDigit; /* Byte 2 */
......@@ -466,9 +447,8 @@ struct BusLogic_BoardID
Define the Inquire Configuration reply structure.
*/
struct BusLogic_Configuration
{
unsigned char :5; /* Byte 0 Bits 0-4 */
struct BusLogic_Configuration {
unsigned char:5; /* Byte 0 Bits 0-4 */
boolean DMA_Channel5:1; /* Byte 0 Bit 5 */
boolean DMA_Channel6:1; /* Byte 0 Bit 6 */
boolean DMA_Channel7:1; /* Byte 0 Bit 7 */
......@@ -476,36 +456,34 @@ struct BusLogic_Configuration
boolean IRQ_Channel10:1; /* Byte 1 Bit 1 */
boolean IRQ_Channel11:1; /* Byte 1 Bit 2 */
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_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 :4; /* Byte 2 Bits 4-7 */
unsigned char:4; /* Byte 2 Bits 4-7 */
};
/*
Define the Inquire Setup Information reply structure.
*/
struct BusLogic_SynchronousValue
{
struct BusLogic_SynchronousValue {
unsigned char Offset:4; /* Bits 0-3 */
unsigned char TransferPeriod:3; /* Bits 4-6 */
boolean Synchronous:1; /* Bit 7 */
};
struct BusLogic_SetupInformation
{
struct BusLogic_SetupInformation {
boolean SynchronousInitiationEnabled:1; /* Byte 0 Bit 0 */
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 PreemptTimeOnBus; /* Byte 2 */
unsigned char TimeOffBus; /* Byte 3 */
unsigned char MailboxCount; /* Byte 4 */
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 Signature; /* Byte 17 */
unsigned char CharacterD; /* Byte 18 */
......@@ -514,7 +492,7 @@ struct BusLogic_SetupInformation
unsigned char WideTransfersActiveID0to7; /* Byte 21 */
struct BusLogic_SynchronousValue SynchronousValuesID8to15[8]; /* Bytes 22-29 */
unsigned char DisconnectPermittedID8to15; /* Byte 30 */
unsigned char :8; /* Byte 31 */
unsigned char:8; /* Byte 31 */
unsigned char WideTransfersPermittedID8to15; /* Byte 32 */
unsigned char WideTransfersActiveID8to15; /* Byte 33 */
};
......@@ -523,8 +501,7 @@ struct BusLogic_SetupInformation
Define the Initialize Extended Mailbox request structure.
*/
struct BusLogic_ExtendedMailboxRequest
{
struct BusLogic_ExtendedMailboxRequest {
unsigned char MailboxCount; /* Byte 0 */
u32 BaseMailboxAddress; /* Bytes 1-4 */
} PACKED;
......@@ -536,8 +513,7 @@ struct BusLogic_ExtendedMailboxRequest
the Modify I/O Address command.
*/
enum BusLogic_ISACompatibleIOPort
{
enum BusLogic_ISACompatibleIOPort {
BusLogic_IO_330 = 0,
BusLogic_IO_334 = 1,
BusLogic_IO_230 = 2,
......@@ -548,37 +524,35 @@ enum BusLogic_ISACompatibleIOPort
BusLogic_IO_Disable2 = 7
} PACKED;
struct BusLogic_PCIHostAdapterInformation
{
enum BusLogic_ISACompatibleIOPort ISACompatibleIOPort;/* Byte 0 */
struct BusLogic_PCIHostAdapterInformation {
enum BusLogic_ISACompatibleIOPort ISACompatibleIOPort; /* Byte 0 */
unsigned char PCIAssignedIRQChannel; /* Byte 1 */
boolean LowByteTerminated:1; /* Byte 2 Bit 0 */
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 JP2:1; /* Byte 2 Bit 5 */
boolean JP3:1; /* Byte 2 Bit 6 */
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.
*/
struct BusLogic_ExtendedSetupInformation
{
struct BusLogic_ExtendedSetupInformation {
unsigned char BusType; /* Byte 0 */
unsigned char BIOS_Address; /* Byte 1 */
unsigned short ScatterGatherLimit; /* Bytes 2-3 */
unsigned char MailboxCount; /* Byte 4 */
u32 BaseMailboxAddress; /* Bytes 5-8 */
struct {
unsigned char :2; /* Byte 9 Bits 0-1 */
unsigned char:2; /* Byte 9 Bits 0-1 */
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 */
unsigned char :1; /* Byte 9 Bit 7 */
unsigned char:1; /* Byte 9 Bit 7 */
} Misc;
unsigned char FirmwareRevision[3]; /* Bytes 10-12 */
boolean HostWideSCSI:1; /* Byte 13 Bit 0 */
......@@ -586,15 +560,14 @@ struct BusLogic_ExtendedSetupInformation
boolean HostSupportsSCAM:1; /* Byte 13 Bit 2 */
boolean HostUltraSCSI:1; /* Byte 13 Bit 3 */
boolean HostSmartTermination:1; /* Byte 13 Bit 4 */
unsigned char :3; /* Byte 13 Bits 5-7 */
unsigned char:3; /* Byte 13 Bits 5-7 */
} PACKED;
/*
Define the Enable Strict Round Robin Mode request type.
*/
enum BusLogic_RoundRobinModeRequest
{
enum BusLogic_RoundRobinModeRequest {
BusLogic_AggressiveRoundRobinMode = 0,
BusLogic_StrictRoundRobinMode = 1
} PACKED;
......@@ -607,8 +580,7 @@ enum BusLogic_RoundRobinModeRequest
#define BusLogic_BIOS_BaseOffset 0
#define BusLogic_AutoSCSI_BaseOffset 64
struct BusLogic_FetchHostAdapterLocalRAMRequest
{
struct BusLogic_FetchHostAdapterLocalRAMRequest {
unsigned char ByteOffset; /* Byte 0 */
unsigned char ByteCount; /* Byte 1 */
};
......@@ -617,16 +589,15 @@ struct BusLogic_FetchHostAdapterLocalRAMRequest
Define the Host Adapter Local RAM AutoSCSI structure.
*/
struct BusLogic_AutoSCSIData
{
struct BusLogic_AutoSCSIData {
unsigned char InternalFactorySignature[2]; /* Bytes 0-1 */
unsigned char InformationByteCount; /* Byte 2 */
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 FloppySecondary:1; /* Byte 10 Bit 1 */
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 DMA_Channel:7; /* Byte 11 Bits 0-6 */
boolean DMA_AutoConfiguration:1; /* Byte 11 Bit 7 */
......@@ -640,7 +611,7 @@ struct BusLogic_AutoSCSIData
boolean NoisyCablingEnvironment:1; /* Byte 15 Bit 3 */
boolean FastSynchronousNegotiation:1; /* Byte 15 Bit 4 */
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 */
unsigned char BusOnDelay; /* Byte 16 */
unsigned char BusOffDelay; /* Byte 17 */
......@@ -648,7 +619,7 @@ struct BusLogic_AutoSCSIData
boolean BIOSRedirectionOfINT19Enabled:1; /* Byte 18 Bit 1 */
boolean ExtendedTranslationEnabled:1; /* Byte 18 Bit 2 */
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 BIOSInterruptModeEnabled:1; /* Byte 18 Bit 6 */
boolean FlopticalSupportEnabled:1; /* Byte 19 Bit 7 */
......@@ -666,22 +637,22 @@ struct BusLogic_AutoSCSIData
boolean VESABurstWriteEnabled:1; /* Byte 33 Bit 6 */
boolean VESABurstReadEnabled:1; /* Byte 33 Bit 7 */
unsigned short UltraPermitted; /* Bytes 34-35 */
unsigned int :32; /* Bytes 36-39 */
unsigned char :8; /* Byte 40 */
unsigned int:32; /* Bytes 36-39 */
unsigned char:8; /* Byte 40 */
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_Enabled:1; /* Byte 42 Bit 2 */
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 :1; /* Byte 43 Bit 1 */
boolean:1; /* Byte 43 Bit 1 */
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 BootChannel:4; /* Byte 44 Bits 4-7 */
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 RenegotiateSyncAfterCheckCondition; /* Bytes 48-49 */
unsigned char Reserved[10]; /* Bytes 50-59 */
......@@ -693,10 +664,9 @@ struct BusLogic_AutoSCSIData
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 :7; /* Bits 1-7 */
unsigned char:7; /* Bits 1-7 */
};
/*
......@@ -705,10 +675,9 @@ struct BusLogic_AutoSCSIByte45
#define BusLogic_BIOS_DriveMapOffset 17
struct BusLogic_BIOSDriveMapByte
{
struct BusLogic_BIOSDriveMapByte {
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 */
unsigned char TargetID:3; /* Bits 5-7 */
};
......@@ -718,8 +687,7 @@ struct BusLogic_BIOSDriveMapByte
necessary to support more than 8 Logical Units per Target Device.
*/
enum BusLogic_SetCCBFormatRequest
{
enum BusLogic_SetCCBFormatRequest {
BusLogic_LegacyLUNFormatCCB = 0,
BusLogic_ExtendedLUNFormatCCB = 1
} PACKED;
......@@ -728,8 +696,7 @@ enum BusLogic_SetCCBFormatRequest
Define the Outgoing Mailbox Action Codes.
*/
enum BusLogic_ActionCode
{
enum BusLogic_ActionCode {
BusLogic_OutgoingMailboxFree = 0x00,
BusLogic_MailboxStartCommand = 0x01,
BusLogic_MailboxAbortCommand = 0x02
......@@ -742,8 +709,7 @@ enum BusLogic_ActionCode
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_CommandCompletedWithoutError = 0x01,
BusLogic_CommandAbortedAtHostRequest = 0x02,
......@@ -756,8 +722,7 @@ enum BusLogic_CompletionCode
Define the Command Control Block (CCB) Opcodes.
*/
enum BusLogic_CCB_Opcode
{
enum BusLogic_CCB_Opcode {
BusLogic_InitiatorCCB = 0x00,
BusLogic_TargetCCB = 0x01,
BusLogic_InitiatorCCB_ScatterGather = 0x02,
......@@ -771,8 +736,7 @@ enum BusLogic_CCB_Opcode
Define the CCB Data Direction Codes.
*/
enum BusLogic_DataDirection
{
enum BusLogic_DataDirection {
BusLogic_UncheckedDataTransfer = 0,
BusLogic_DataInLengthChecked = 1,
BusLogic_DataOutLengthChecked = 2,
......@@ -785,8 +749,7 @@ enum BusLogic_DataDirection
return status code 0x0C; it uses 0x12 for both overruns and underruns.
*/
enum BusLogic_HostAdapterStatus
{
enum BusLogic_HostAdapterStatus {
BusLogic_CommandCompletedNormally = 0x00,
BusLogic_LinkedCommandCompleted = 0x0A,
BusLogic_LinkedCommandCompletedWithFlag = 0x0B,
......@@ -819,8 +782,7 @@ enum BusLogic_HostAdapterStatus
Define the SCSI Target Device Status Codes.
*/
enum BusLogic_TargetDeviceStatus
{
enum BusLogic_TargetDeviceStatus {
BusLogic_OperationGood = 0x00,
BusLogic_CheckCondition = 0x02,
BusLogic_DeviceBusy = 0x08
......@@ -830,8 +792,7 @@ enum BusLogic_TargetDeviceStatus
Define the Queue Tag Codes.
*/
enum BusLogic_QueueTag
{
enum BusLogic_QueueTag {
BusLogic_SimpleQueueTag = 0,
BusLogic_HeadOfQueueTag = 1,
BusLogic_OrderedQueueTag = 2,
......@@ -852,8 +813,7 @@ typedef unsigned char SCSI_CDB_T[BusLogic_CDB_MaxLength];
Firmware Interface and the FlashPoint SCCB Manager.
*/
struct BusLogic_ScatterGatherSegment
{
struct BusLogic_ScatterGatherSegment {
u32 SegmentByteCount; /* Bytes 0-3 */
u32 SegmentDataPointer; /* Bytes 4-7 */
};
......@@ -862,8 +822,7 @@ struct BusLogic_ScatterGatherSegment
Define the Driver CCB Status Codes.
*/
enum BusLogic_CCB_Status
{
enum BusLogic_CCB_Status {
BusLogic_CCB_Free = 0,
BusLogic_CCB_Active = 1,
BusLogic_CCB_Completed = 2,
......@@ -890,13 +849,12 @@ enum BusLogic_CCB_Status
32 Logical Units per Target Device.
*/
struct BusLogic_CCB
{
struct BusLogic_CCB {
/*
MultiMaster Firmware and FlashPoint SCCB Manager Common Portion.
*/
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 */
boolean TagEnable:1; /* Byte 1 Bit 5 */
enum BusLogic_QueueTag QueueTag:2; /* Byte 1 Bits 6-7 */
......@@ -904,8 +862,8 @@ struct BusLogic_CCB
unsigned char SenseDataLength; /* Byte 3 */
u32 DataLength; /* Bytes 4-7 */
u32 DataPointer; /* Bytes 8-11 */
unsigned char :8; /* Byte 12 */
unsigned char :8; /* Byte 13 */
unsigned char:8; /* Byte 12 */
unsigned char:8; /* Byte 13 */
enum BusLogic_HostAdapterStatus HostAdapterStatus; /* Byte 14 */
enum BusLogic_TargetDeviceStatus TargetDeviceStatus; /* Byte 15 */
unsigned char TargetID; /* Byte 16 */
......@@ -913,18 +871,18 @@ struct BusLogic_CCB
boolean LegacyTagEnable:1; /* Byte 17 Bit 5 */
enum BusLogic_QueueTag 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 */
unsigned char:8; /* Byte 30 */
unsigned char:8; /* Byte 31 */
unsigned int:32; /* Bytes 32-35 */
u32 SenseDataPointer; /* Bytes 36-39 */
/*
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 */
enum BusLogic_CompletionCode CompletionCode; /* Byte 48 */
#ifndef CONFIG_SCSI_OMIT_FLASHPOINT
unsigned char :8; /* Byte 49 */
unsigned char:8; /* Byte 49 */
unsigned short OS_Flags; /* Bytes 50-51 */
unsigned char Private[48]; /* Bytes 52-99 */
#endif
......@@ -948,10 +906,9 @@ struct BusLogic_CCB
Define the 32 Bit Mode Outgoing Mailbox structure.
*/
struct BusLogic_OutgoingMailbox
{
struct BusLogic_OutgoingMailbox {
u32 CCB; /* Bytes 0-3 */
unsigned int :24; /* Bytes 4-6 */
unsigned int:24; /* Bytes 4-6 */
enum BusLogic_ActionCode ActionCode; /* Byte 7 */
};
......@@ -959,12 +916,11 @@ struct BusLogic_OutgoingMailbox
Define the 32 Bit Mode Incoming Mailbox structure.
*/
struct BusLogic_IncomingMailbox
{
struct BusLogic_IncomingMailbox {
u32 CCB; /* Bytes 0-3 */
enum BusLogic_HostAdapterStatus HostAdapterStatus; /* Byte 4 */
enum BusLogic_TargetDeviceStatus TargetDeviceStatus; /* Byte 5 */
unsigned char :8; /* Byte 6 */
unsigned char:8; /* Byte 6 */
enum BusLogic_CompletionCode CompletionCode; /* Byte 7 */
};
......@@ -973,8 +929,7 @@ struct BusLogic_IncomingMailbox
Define the BusLogic Driver Options structure.
*/
struct BusLogic_DriverOptions
{
struct BusLogic_DriverOptions {
unsigned short TaggedQueuingPermitted;
unsigned short TaggedQueuingPermittedMask;
unsigned short BusSettleTime;
......@@ -987,8 +942,7 @@ struct BusLogic_DriverOptions
Define the Host Adapter Target Flags structure.
*/
struct BusLogic_TargetFlags
{
struct BusLogic_TargetFlags {
boolean TargetExists:1;
boolean TaggedQueuingSupported:1;
boolean WideTransfersSupported:1;
......@@ -1006,8 +960,7 @@ struct BusLogic_TargetFlags
typedef unsigned int BusLogic_CommandSizeBuckets_T[BusLogic_SizeBuckets];
struct BusLogic_TargetStatistics
{
struct BusLogic_TargetStatistics {
unsigned int CommandsAttempted;
unsigned int CommandsCompleted;
unsigned int ReadCommands;
......@@ -1041,8 +994,7 @@ typedef unsigned int FlashPoint_CardHandle_T;
by the FlashPoint SCCB Manager.
*/
struct FlashPoint_Info
{
struct FlashPoint_Info {
u32 BaseAddress; /* Bytes 0-3 */
boolean Present; /* Byte 4 */
unsigned char IRQ_Channel; /* Byte 5 */
......@@ -1063,7 +1015,7 @@ struct FlashPoint_Info
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:7; /* Byte 21 Bits 1-7 */
unsigned char Family; /* Byte 22 */
unsigned char BusType; /* Byte 23 */
unsigned char ModelNumber[3]; /* Bytes 24-26 */
......@@ -1079,8 +1031,7 @@ struct FlashPoint_Info
Define the BusLogic Driver Host Adapter structure.
*/
struct BusLogic_HostAdapter
{
struct BusLogic_HostAdapter {
struct Scsi_Host *SCSI_Host;
struct pci_dev *PCI_Device;
enum BusLogic_HostAdapterType HostAdapterType;
......@@ -1180,8 +1131,7 @@ struct BusLogic_HostAdapter
Define a structure for the BIOS Disk Parameters.
*/
struct BIOS_DiskParameters
{
struct BIOS_DiskParameters {
int Heads;
int Sectors;
int Cylinders;
......@@ -1191,8 +1141,7 @@ struct BIOS_DiskParameters
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 PeripheralQualifier:3; /* Byte 0 Bits 5-7 */
unsigned char DeviceTypeModifier:7; /* Byte 1 Bits 0-6 */
......@@ -1201,15 +1150,15 @@ struct SCSI_Inquiry
unsigned char ECMA_Version:3; /* Byte 2 Bits 3-5 */
unsigned char ISO_Version:2; /* Byte 2 Bits 6-7 */
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 AENC:1; /* Byte 3 Bit 7 */
unsigned char AdditionalLength; /* Byte 4 */
unsigned char :8; /* Byte 5 */
unsigned char :8; /* Byte 6 */
unsigned char:8; /* Byte 5 */
unsigned char:8; /* Byte 6 */
boolean SftRe:1; /* Byte 7 Bit 0 */
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 Sync:1; /* Byte 7 Bit 4 */
boolean WBus16:1; /* Byte 7 Bit 5 */
......@@ -1244,8 +1193,7 @@ static inline void BusLogic_ReleaseHostAdapterLock(struct BusLogic_HostAdapter *
but is only called from the interrupt handler.
*/
static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter,
unsigned long *ProcessorFlags)
static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, unsigned long *ProcessorFlags)
{
spin_lock_irqsave(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);
}
......@@ -1256,8 +1204,7 @@ static inline void BusLogic_AcquireHostAdapterLockIH(struct BusLogic_HostAdapter
but is only called from the interrupt handler.
*/
static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter,
unsigned long *ProcessorFlags)
static inline void BusLogic_ReleaseHostAdapterLockIH(struct BusLogic_HostAdapter *HostAdapter, unsigned long *ProcessorFlags)
{
spin_unlock_irqrestore(HostAdapter->SCSI_Host->host_lock, *ProcessorFlags);
}
......@@ -1273,8 +1220,7 @@ static inline void BusLogic_SCSIBusReset(struct BusLogic_HostAdapter *HostAdapte
union BusLogic_ControlRegister ControlRegister;
ControlRegister.All = 0;
ControlRegister.cr.SCSIBusReset = true;
outb(ControlRegister.All,
HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
}
static inline void BusLogic_InterruptReset(struct BusLogic_HostAdapter *HostAdapter)
......@@ -1282,8 +1228,7 @@ static inline void BusLogic_InterruptReset(struct BusLogic_HostAdapter *HostAdap
union BusLogic_ControlRegister ControlRegister;
ControlRegister.All = 0;
ControlRegister.cr.InterruptReset = true;
outb(ControlRegister.All,
HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
}
static inline void BusLogic_SoftReset(struct BusLogic_HostAdapter *HostAdapter)
......@@ -1291,8 +1236,7 @@ static inline void BusLogic_SoftReset(struct BusLogic_HostAdapter *HostAdapter)
union BusLogic_ControlRegister ControlRegister;
ControlRegister.All = 0;
ControlRegister.cr.SoftReset = true;
outb(ControlRegister.All,
HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
}
static inline void BusLogic_HardReset(struct BusLogic_HostAdapter *HostAdapter)
......@@ -1300,8 +1244,7 @@ static inline void BusLogic_HardReset(struct BusLogic_HostAdapter *HostAdapter)
union BusLogic_ControlRegister ControlRegister;
ControlRegister.All = 0;
ControlRegister.cr.HardReset = true;
outb(ControlRegister.All,
HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
outb(ControlRegister.All, HostAdapter->IO_Address + BusLogic_ControlRegisterOffset);
}
static inline unsigned char BusLogic_ReadStatusRegister(struct BusLogic_HostAdapter *HostAdapter)
......@@ -1310,8 +1253,7 @@ static inline unsigned char BusLogic_ReadStatusRegister(struct BusLogic_HostAdap
}
static inline void BusLogic_WriteCommandParameterRegister(struct BusLogic_HostAdapter
*HostAdapter,
unsigned char Value)
*HostAdapter, unsigned char Value)
{
outb(Value, HostAdapter->IO_Address + BusLogic_CommandParameterRegisterOffset);
}
......@@ -1384,7 +1326,8 @@ static inline u32 Virtual_to_32Bit_Virtual(void *VirtualAddress)
static inline void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter)
{
if (*ErrorCounter < 65535) (*ErrorCounter)++;
if (*ErrorCounter < 65535)
(*ErrorCounter)++;
}
/*
......@@ -1392,12 +1335,10 @@ static inline void BusLogic_IncrementErrorCounter(unsigned short *ErrorCounter)
*/
static inline void BusLogic_IncrementByteCounter(struct BusLogic_ByteCounter
*ByteCounter,
unsigned int Amount)
*ByteCounter, unsigned int Amount)
{
ByteCounter->Units += Amount;
if (ByteCounter->Units > 999999999)
{
if (ByteCounter->Units > 999999999) {
ByteCounter->Units -= 1000000000;
ByteCounter->Billions++;
}
......@@ -1407,24 +1348,21 @@ static inline void BusLogic_IncrementByteCounter(struct BusLogic_ByteCounter
BusLogic_IncrementSizeBucket increments the Bucket for Amount.
*/
static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T
CommandSizeBuckets,
unsigned int Amount)
static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T CommandSizeBuckets, unsigned int Amount)
{
int Index = 0;
if (Amount < 8*1024)
{
if (Amount < 2*1024)
Index = (Amount < 1*1024 ? 0 : 1);
else Index = (Amount < 4*1024 ? 2 : 3);
}
else if (Amount < 128*1024)
{
if (Amount < 32*1024)
Index = (Amount < 16*1024 ? 4 : 5);
else Index = (Amount < 64*1024 ? 6 : 7);
}
else Index = (Amount < 256*1024 ? 8 : 9);
if (Amount < 8 * 1024) {
if (Amount < 2 * 1024)
Index = (Amount < 1 * 1024 ? 0 : 1);
else
Index = (Amount < 4 * 1024 ? 2 : 3);
} else if (Amount < 128 * 1024) {
if (Amount < 32 * 1024)
Index = (Amount < 16 * 1024 ? 4 : 5);
else
Index = (Amount < 64 * 1024 ? 6 : 7);
} else
Index = (Amount < 256 * 1024 ? 8 : 9);
CommandSizeBuckets[Index]++;
}
......@@ -1450,20 +1388,14 @@ static inline void BusLogic_IncrementSizeBucket(BusLogic_CommandSizeBuckets_T
static const char *BusLogic_DriverInfo(struct Scsi_Host *);
static int BusLogic_DetectHostAdapter(struct scsi_host_template *);
static int BusLogic_ReleaseHostAdapter(struct Scsi_Host *);
static int BusLogic_QueueCommand(struct scsi_cmnd *,
void (*CompletionRoutine)(struct scsi_cmnd *));
static int BusLogic_BIOSDiskParameters(struct scsi_device *,
struct block_device *,
sector_t, int *);
static int BusLogic_ProcDirectoryInfo(struct Scsi_Host *, char *,
char **, off_t, int, int);
static int BusLogic_QueueCommand(struct scsi_cmnd *, void (*CompletionRoutine) (struct scsi_cmnd *));
static int BusLogic_BIOSDiskParameters(struct scsi_device *, 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 void BusLogic_QueueCompletedCCB(struct BusLogic_CCB *);
static irqreturn_t BusLogic_InterruptHandler(int, void *, struct pt_regs *);
static int BusLogic_ResetHostAdapter(struct BusLogic_HostAdapter *,
boolean HardReset);
static void BusLogic_Message(enum BusLogic_MessageLevel, char *,
struct BusLogic_HostAdapter *, ...);
static int BusLogic_ResetHostAdapter(struct BusLogic_HostAdapter *, boolean HardReset);
static void BusLogic_Message(enum BusLogic_MessageLevel, char *, struct BusLogic_HostAdapter *, ...);
static int __init BusLogic_Setup(char *);
#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